Activating a Modal for non registered users onLoad and onClick
Hi guys I am using Wordpress, and have a members only lockdown for 95% of the site, but the homepage is viewable to all. The homepage however has links, which link through to articles etc for members only, and a few other links which I would like anybody to be able to click, e.g social. My fiddle below is basic, it checks for non logged in users via the body class in Wordpress, and activates a Login modal for them on page load. I would also like this modal to activate when they click any links bar
.html() issue with unordered list
I am having an issue with setting the html of a ul. I am using jquery-2.1.1.min.js My simplified code is as follows; <ul id="test-ul"> <li>first</li> <li>second</li> </ul> <script type="text/javascript"> $(document).ready(function(){ $("#test-ul").html("<li>new first</li><li>new second</li>"); }) </script> The code works fine but the browsers return errors as follows: IE11 returns the error: 'SCRIPT438: Object doesn't support property or method 'getAttribute'' Firebug returns the error:
Syntex Error: missing ) after argument list
Hi, Can someone tell me how to fix this. I get the same error for the commented out $.each also. I have tried to make this as simple as I can so show no other code. accData was returned from an AJAX call. function showTable(acctData) { //$.each(accData, function(i, item) { // alert(data[i].invNo); //}); $.each(accData, function() { $.each(this.function(name,value) { document.write(name+" = "+value); }); }); }
function checkuser()
I modified a jQuerry script to use it on my login.php. In the script is a function called checkuser(). This function will fade in a msg to register, when the username does not exist/ / is invalid. Right now as I'm using this code, every username is invalid. So how am I gonna check my database using this code? <div id="register-inner"> {{ Form::text('username', '', array ('id' => 'reg-user', 'class' => 'login-input required', 'placeholder' => 'Username', 'autocomplete' => 'off')) }} </div>
CSS style not being honoured
Hi Guys, When I debug my CSS properties under Chrome it normally shows the proper *.css file under the “Styles” tab of the rule it applied to my element (‘button’ in this case). Just now I am struggling with the case where it shows me something like this (no source .css file at all): input[type="button"],input[type="submit"], input[type="reset"],input[type="file"]::-webkit-file-upload-button, button { 1. padding : 1px 6px; } I specified for my button element the bootstrap.css classes “ .btn-primary”
show thumbnail photo in full size with jquery
hi everyone! I am a beginner in jquery. I create a photo gallery with jquery that works like this: my page has two sides for showing photos: left and right. in the left I have some thumbnail photos that when I click on each of them, it appears bigger in right side of the window. but I want to do this: if I click in a single lage size of photo that is in right side, it shows that in a full size in all of the screen with a light background. Is there any one who helps me for fixing that? thank you so
How to toggle html forms within a php loop individually?
I have a php loop that fetches records from the database. <?php $comments=array('comment1','comment2','comment3','comment4','comment5','comment6 ','comment7','comment8','comment9'); $c_count = count($comments); for($i=0; $i<$c_count; $i++){ $comment = $comments[$i]; echo '<button value="Show Reply Form"></button>'; echo '<div class="comment_box">' echo $comment['comment']; echo '<form action="path/to/insert_reply.php" method="POST">'; echo '<textarea name="about" cols="47" rows="4"></textarea>';
Question about jquery versions
Hello, How ca i make jquery-1.10.2.min to works with jquery-1.7.2.min. because i have jquery-1.7.2.min in my template but i use jquery-1.10.2.min for develloping my application
"ReferenceError: $ is not defined" bug with Firefox
Hi, i am using jquery for creating highlighted hotspots in a image. The idea consists of highlight some areas of the picture when the mouse is over those areas. The code is as follows (sorry for the plain text; the code shall run in Eclipse Process Framework Composer and this enviroment is not the most confortable for coding). Once generated the .html, it works perfect with IE (i attach a screenshot of the html file opened with IE showing one of the areas highlighted) but with Firefox the web works
Anyway to test only for keys that would clear out a text field(backspace, delete) or other such actions.
Hello, I want to exclude regular alphabet characters. I have a function that Im trying to use: $("#TO").on("keydown", ".TO", function(){ var $this = $(this).val(); if ($this == "") { $(this).empty().remove(); } }); Is there a way to say keydown.not(keypress). In other words I want to only remove the element if they do backspace or other such actions to clear out a textfield.
Why my Php/Jquery script causes the images to overlap?
I'm using jQuery Infinite Scroll Pagination in conjunction with masonry to position each element in the next open spot in the grid, and within this script i have a (while loop) that fetches records from the database, everything seems to be working properly until i start to scroll down then something goes wrong and causes item elements to overlap showing the images overlapping one another. I tried solutions like Imagesloaded but i had no luck. Kindly check out my code below and tell me what goes wrong.
Remove a tag
Hi, For some reason Wordpress is generating a ul tag inside my ul tag which is totally useless. This is the current code: <ul class="dropdown-menu"> <li class="active dropdown-submenu menu-fleckenbehandlung"><a href="/akorug/1681-2/">Fleckenbehandlung</a> <ul class="dropdown-menu"> <li class="menu-tiefenreinigung"><a href="/akorug/1692-2/">Tiefenreinigung</a></li> <li class="menu-restauration"><a href="/akorug/aus-alt-macht-neu/">Restauration</a></li> <li class="menu-preisliste"><a href="/akorug/preisliste/">Preisliste</a></li>
How to fix IE error in dropdown hide
I'm using IE10 and Jquery 1.11 As known, IE has problems hiding options in dropdown menu.So I've written the following code to overpass the issue. The code runs fine when filtering, but deleting characters, don't show all the options. The code is: function filterDP(element) { var value = $(element).val(); var dropdown = "#dropdown1"; $( dropdown+" > option").each(function() { var optionValue = $(this).val(); if (navigator.appName == 'Microsoft Internet Explorer') { $(dropdown).find('option[value="'
jQuery v1.10.1 compatibily with Internet Explorer 11
Hi, For our application jQueryv1.10.1 has been used. In I E11 compatibility Mode , when testing a functionality instead of alerts nothing happens after few seconds getting the below: This page can’t be displayed Make sure the web address https:// xxxx is correct. Look for the page with your search engine. Refresh the page in a few minutes. Please someone help here Thanks Swetha
How to force print background and color using printThis plugin by jasonday
Hello! I am using the printThis plugin created by jasonday (nice plugin btw) https://github.com/jasonday/printThis/blob/master/printThis.js to print a part of my page. It is working fine except that it doesn't print the background and the color which is in the page (normal). And I want to print the page "As it is". I know that there is a checkbox in the browser print settings that you can check to print those ones. I know that there is not really a way to force the browser to print the background-image
Div size to be the same as the parent
Hi I have a div, called reccontainer, this has several divs of class rec in, basically a tile type selector for records. I wish to have the onclick of any clicks on class rec to animate the div to fill the reccontainer. I have tried this so far, everything works apart from xNewSize, it seems to move the div when i change the size $(".rec").click( function () { xShift = $(this).position().left - $("#reccontainer").position().left; yShift = $(this).position().top - $("#reccontainer").position().top;
fadein on top of div on mobile using normal jquery.js
Hello, I just started out with jQuery and i encounter a problem when using jQuery normal when looking at the site from a iPhone. When i scroll down, the div thats fadein only shows when passing the bottom of the div. i woould like the div to show when the top is reached. This is my code: <script> $(document).ready(function () { /* Every time the window is scrolled ... */ $(window).scroll( function(){ /* Check the location of each desired element */ $('.box').each( function(i){
JQuery compatibility problem
I created a single page personnel website using JQuery http://ramzi-bk.net84.net/ . During developement i did'nt make attention to cross platform compatibility and used only firefox to test it. Everything when fine until i try it under chrome then under IE to find out the big mistake. Under Chrome i get these error messages: > Uncaught SyntaxError: Unexpected end of input. > Uncaught SyntaxError: Unexpected token < > Uncaught TypeError: undefined is not a function external.js:49
How to separate responsibilities inside the js code?
I have the following implementation, which will render the results of a json in the screen. However, for test purposes, I had to comment the line serviceRequestListTabsController.showActive(); below. Nevertheless, another project makes use exactly of the same implementation, and need to use the showActive() function. Thus, I cannot commit this code, otherwise I will break other people's code. How can I separate it using Spring, Interface, or whatever makes it easier? Thanks. $(document).delegate('.menu
Any way to exclude hidden fields when getting width of column
Hello, Im obtaining the width of columns from a table. There are columns that contain hidden fields along with data. Is there a way that I can just get the width of the string without the hidden data? Thanx
serializeArray behavior not as expected.
http://jsfiddle.net/Bz4x4/7/ In the above example, I would expect an input field of type 'number' to be extracted as a number, but instead, I'm seeing it is converted to a String. While this is valid JSON format, it results in inaccurate typing of variables which is problematic when this data is then put into JSON (via JSON.stringify) and passed to the back end of an application I'm working on. I tried using jQuery 1.9.1 and 1.11.1 I believe this is a bug, but would be interested in hearing why
Problem with not()
Hi This is a part of my script which will close a popup: $("body:not(#popup)").click(function() { if(popup_zustand == true) { $("#popup").fadeOut("normal"); $("#hintergrund").fadeOut("normal"); popup_zustand = false; } }); You will find the problem on the first line. I want the popup to get closed whenever I click anywhere but not on the popup itself (that means #popup). The way I did, it closes the popup everytime, even when I click on
Opening multiple dialogs from a select box
I can open a dialog when I click on an option in my select box but when i try to open a second one the first one closes. Can't figure out why it is closing. Any help would be appeiciated. Thanks // Builds list of tests in the update dialog function loadTests(testList) { // Ctrates dropdown with list of active reports $(testList).find('test').each(function(index, element) { var id = $(this).find('id').text(); var name = $(this).find('name').text(); console.log(id + ':' + name); <!--
Accept header not working
I have to call for an web service which requires a Accept header and then it returns a json result. I test the service with "Postman" and got the response succesfully.but its not working when trying to do programatically $(document).ready(function () { var xhr = new XMLHttpRequest(); $.ajax({ url: 'http://102.22.169.113:9763/services/charaka_DataService/select_all_configs_operation?config_key=MAX', type: 'GET', dataType: 'json',
Undefined
Hey all, I have a very strange problem that I never encountered and which I cannot solve in any way. I have been using JQuery a lot in the past years and I never encountered the issue which I will be describing. Basically I am seeing that when the page does not load completely (because I would be loading everything asynchronously) and I try to refresh a Page or click an HREF link I get an undefined error. Sometimes I the undefined dialog box is shown once, sometimes more than once. However when I
Failing miserably to read radio value despite previous examples
Folks, I have used the example listed on the api page: http://api.jquery.com/val/ // Get the value from a set of radio buttons $( "input:radio[name=bar]:checked" ).val(); but I don't get a value (I get nothing, not "undefined", not 0, nothing). My html is as follows: Yes<input type="radio" name="ProductExtraActive" id="ProductExtraActiveY" value="Y" checked> No<input type="radio" name="ProductExtraActive" id="ProductExtraActiveN" value="N"> Some of my attempts that have returned empty: $( "input:checked"
jquery 1.9.1 ajax memory leak on ios7.1.2
The following code i run on iPhone5 UIWebView and test by Instruments. The imageData.js contains 1.5M image encoded by base64. $.ajax({ url: "js/imageData.js", dataType: "script", cache:false, success: function(){ $("#tryImg").attr("src","data:"+imageBase64); } }); Finding: 1. When calling the data without cache. The WebCore purgeable data cannot release and memory keep expend while ajax repeat call. 2. When ajax is cached. There is only one WebCore purgeable data copy and no memory expend.
Jquery file input field change
Hi, When i click Input file field if field hold a value then dynamically add extra one file input field in jquery with easy example.! let me know for my doubt.! Thanks again, Regards, Laxmanvel
Showing & Hiding Stacked Divs on Click
Hi, First time poster here… Have a single page app with a section that has 5 divs stacked on top of each other. It basically looks like this: <div container> <div 1> <div 2> <div 3> <div 4> <div 5> </container> Below the divs are a left and right arrow that cycle through the divs infinitely in each direction. I'm trying to to do something like this: var objects = [ '#div1', '#div2', '#rdiv3', '#div4', '#div5']; function moveRight () { cycle right
How to ignore validating Text and Select in jQuery
Hi, I have been searching the net for the past 5 days trying to find a way to ignore validating hidden fields that are both, select and text, but I was not able to find any supporting form. By Default, jQuery ignores the hidden fields as long as they are text fields, but when I use ignore: "select:visible" the whole validation stops working. What I am trying to do is: when choosing a gender, 5 fields appear depending if the gender is male/female or Company. For some reason the text fields are working
Load when visible
I am going to use this bar chart and need it to load only when visible. As of now I can only have delayed. Any suggestions?
net::ERR_FAILED.. cant cache js files with chrome extensions
chrome(Version 36.0.1985.125 m) all of my js files i do call as xhr. if i add my .js files under the cache header of cache manifest.. than my adBlocke and adBlockPlus chrome extensions are blocking all that xhr calls and as results the website look very bad! the only way i've managed to get around this.. is if i adds all that .JS files under NETWORK: header..., but than i lose the cachability. as far as i know, i have no resource name path that contains "ad, banner, .." but i do have a google analytics
Get jQuery value into PHP Code
I have some data assigned in jQuery code that I need to send over to my PHP script and I m not quite sure how to do it. I have a main page "benefit.htm" which calls a JavaScript function "getApplicantInfo()" defined in the source file "applicant_info.js". The get Applicant function then calls "selectBenefit.js" and tries to pass the value "$(#ss_id_other").val()" to the "selectBenefit.js" file as the vaaribale "ss_num" within that file. How can this be accomplished? Source code snippets are included
serializeArray() only getting first value
Hi all - I have some dynamically created HTML that looks like this: <div class="medium-12 columns section center"> <h1> What are the options? </h1> <textarea name="choice1" class="multioption" placeholder="Type in a choice" style="overflow: hidden; word-wrap: break-word; resize: horizontal; height: 66px; opacity: 1;"></textarea> <textarea name="choice2" class="hidden" placeholder="Add another answer..." style="overflow: hidden; word-wrap: break-word; resize: horizontal; height:
How can I obtain the width of all the columns in a table
Hello, Im trying to create an array of all the column widths in a table. I have this but it appears to be only returning the first column. var $wid = $("#hbdetail td").outerWidth(true);
How to call a function in another js file?
Hi, It a basic stuff. I have a function test() in a.js and want to call it inside another function in the file b.js, how do I do it? I am not managing to make it working. Message in Eclipse when trying to open the Declaration is that "Current text selection does not resolve to a JavaScript element".
Novice
Hello there, I am sorry I am French and my English is bad, but I need help. I do not understand why when widgets are combined, they do not work normal. thank you very much
How to execute function after 2 seconds after the page loads?
Hello friends, I am again. I need your help please. My function: <?php echo recaptcha_get_html($publickey); ?> Idea: Execute function after 2 seconds after the page loads, maybe with ajax or setTimeout ()
parent/child selector issues
Gentlemen, I'm back with a conundrum for you. I've been happily coding away, adding more and more features to my little project, and finding that things are smoother and smoother as I learn more and more. But parent/child selectors aren't working for me and it's causing me grief. Here's the code that I want to work: $("#target > .thick").empty().append('Adding Child Question'); It does nothing! $("#target").children('.thick').empty().append('Adding Child Question'); Also does nothing! However: $(".thick").empty().append('Adding
Tailing HTTP output to display in dialog
I have built an application which allows the user to upload a zip of csv files to insert into a database schema. the files can be big. it can take some time to run, and there could be loads of integrity issues to report, duplicate fields, bad values etc etc.. while ti may be best to just shunt this all off to some back end process which sticks the output of everything into some log in a db which can then be viewed later (a solution I've seen), it would be nice to read the output as it dribbles out
Next Page