global variable vs. passing a variable into an option's function
Some code for the source: option in Autocomplete does not work when I try to pass a variable (containing an array) into the function, but the code works when I don't try to pass it into the function. What's happening here - or am I doing something wrong in the 2d case? This works seems like threeStepCountries is a global - var threeStepCountriesTest = [ "US", "GB", "PH", "ZM" ]; $("#neighborhood").autocomplete({ source: function ( request, response ){ if ( $.inArray( countrySelected,
jQuery function $('selector', variable) [RESOLVED]
Hello everybody, I'm reading a book about jQuery and sometimes it's writen something like $('selector', variable), but I only know the meaning of $('selector'), and the author doesn't explain. So what's the utility of the variable at the end of the function $() after the coma ? Why it is used ? An exemple of code given in the book is $(document).ready(function() { $('#news-feed').each(function() { var $container = $(this); $container.empty(); $.get('news/feed.xml',
Difference between asynchronous and synchronous
what is the meaning of asynchronous and synchronous in Ajax or anything related both of this?
Wich tutorials or courses for studying jQuery?
hy, I'm beginner in web-programming and now I'm going to start learning jQuery. wich tutorials or video courses do you prefer for begginers, from where can I beggin? If someone know where to find jQuery studying courses please Link here! this help won't be only for me, it will help every beginner ! if you now something please Link Here ! thanks : ))
How To Save Page Table content as A Text file Using Java script?
Hi Experts, I Have data in a table with id tblData. I want save this data into a text file using Javascript. Please Provide a solution to save in text file. Thanks and regards E V Krishna
Div - once selected, keep div shown/visible hitting the back button.
Hi guys, My div toggle works fine, but when I go back to the page my div is hidden again. How would I keep my div open/visible if I decide to go back to the previous page? Kind regards http://jsfiddle.net/Csed2/7/ $('input[name="Q45_A_8"]').change(function() { if(1 == $(this).val()) { $('#myDiv').show(); } else { $('#myDiv').hide(); } });
I would like to know how to call json web service (asp.net webapi)
I created web service (asp.net web api) return json and i would like to call it with jquery. please advice me. my url service http://nservice.no-ip.info/smartservice/api/categories
jQuery to change a div color?
I'm new to jQuery and about as new as you can get and my question is can jQuery be used to change the background color of a div? My scenario is this, I have a form that returns a MySQL search result that has a field that tells if a payment has been paid in full or if no payment has been made, what I want is to have the div background color change from white to a light green color if the status of the payment field say's "Paid in Full" or a light red if it say's "No Payment". Is this possible to
+ variable + operator?
Hello everyone, I'm aware of the main operators but the following is not clear to me. What does it mean if a variable has a plus sign on each side of it? (index: "+ i +) for example For further code: http://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_dom_html_callback Thank you so much in advance!
MAC OS dock
Just now i challenged myself to code something which behaves like the MAC OS dock. here is is http://jsfiddle.net/iconofsin/44j3e/1/ 1) The items move down the page, i would rather they just went off screen (and stayed on one line) how can i do this? 2) any glitches with it 3) Someone challenge me to add something to it 4) What do people think (yes i know its simple but i am proud of it)
Hiding Checkboxes inside of a DIV
I have the following html code and I am trying to conditionally hide checkboxes inside of this div. <div class="form-item form-type-checkbox form-item-field-unlimited-area-507.3"> <input type="checkbox" id="edit-field-unlimited-area-5073" name="field_unlimited_area[507.3]" value="507.3" class="form-checkbox"> <label class="option" for="edit-field-unlimited-area-5073">Section 507.3 - unlimited area for a B, F, M or S building no more than one story above grade plane. </label> </div> In theory
Intimidated and overwhelmed, need help with something simple (I think)
Hey folks- I was directed here by reddit/r/wordpress when looking into making external links on my site open in a new window. I was doing it manually and they said the jquery script will make it much easier. I came here and am just finding my newb self overwhelmed. What do I need to do to make it happen? I see the script, what file does it go on for my wordpress FTP? Which script do I use? etc Sincerely confused and thanks in advance John
Width of image
I'm trying to find the displayed width/height of an image, but keep getting slightly off values. After researching it seems it should be in a window.load function, so here's what I have: $(window).load(function() { $(function() { $('#item0_%id% ul li#itemimg0_%id% img').load(function() { var w = this.width; var h = this.height; $(this).removeAttr('width').removeAttr('height'); var image = $('#item0_%id% ul li#itemimg0_%id% img'); var imgwd = image.width();
Show / hide div with or statements?
Hi gang, I'm trying to show my DIV with just the 2nd, 3rd, 4th & 5th selection for my "Other subject" option. I can get it to work with just one option or all options, but I can't seem to get it to work with just like 2nd through 5th option. Please help, Kind regards. http://jsfiddle.net/Luck12/DH9CT/3/ $('input[name="Q14_A_5"]').change(function() { if( 2 || 3 || 4 || 5 == $(this).val())
Having issues with .not with :contains
I'm having an issue making something work that I think should work fairly easy here is some code var ShowVar = ".search:contains(" + document.getElementById("Find").value +")"; $('.search').not(ShowVar).hide(); $(ShowVar).not('.define').show(); <div id=Ex class=search> Content <ul class=define> <li>List</li> </ul> </div> I'm trying to make it so a user can type in a value for "Find" and it shows all the sections with the class of search and hides I can do that easily, but I want it to ignore the
Drilling down syntax
Hello, I am reading from a jQuery ebook and I came across this syntax: $("div>ul a"); $("div#main p strong"); $("div.main p>li a"); My question is regarding the > and then sometimes a space then another html tag like p or strong etc. Can $("div.main p>li a"); be rewritten as: $("div.main>p>li>a"); // ? is this the same? Does a space as in $("div#main p strong"); // mean $("div#main>p>strong"); Thanks, Jim
Struggling to Study the data
I can't understand the following data.Is any one explain this? Data = {'Test1':2,'Test2':3,'Test3':4,'Test4':0,'Test5':4,'Test6':0}; In above line how to add the data and how to retrieve this data?Is any documentation is there to study? My code: Data = {'Test1':2,'Test2':3,'Test3':4,'Test4':0,'Test5':4,'Test6':0}; console.log('::::::Data :::::;'+Data ); for(var name in Data ){ console.log('::::::name:::::;'+name); createSlider(name,Data [name]); }
Jquery Dynamic object issue
Hi All, I have an issue. My xxx image is a droppable image.When i drag <p> object on the xxx image <p> is dropping but when i create dynamicly xxx image is not being droppable!! My code is below, Please help me about this issue <!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>jQuery UI Droppable - Revert draggable position</title> <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /> <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
Blank drop down menu
Hi everyone, I am rather new to jQuery and php. I would like to make a drop down menu and have read the documentation. I have created a drop down menu <select id = "animals"> <option value="Mouse">Mouse</option> <option value="Cat">Cat</option> <option value="Dog">Dog</option> </select> Then I have my script running var animals = $('#animals').val(); if (animals == "Mouse){ // do stuff } However what I would like to do is populate the drop down menu with a blank or white
Submit button and function coding
I am new to Javascript and jQuery. I have a form with a multiple submit buttons, each with an id. In the example below, the id="modify". What I want to do, is create a click event (or submit event) that will execute the code within the called function 'modify''. I have the function code in the head section and the form's submit button in the body. Here is the code I have been trying to get to work: <script type="text/javascript" src="../schedule/js/jquery-1.7.1.min.js"></script> <script> document.onload
Understanding the way .get() works
Hey all, I'm relatively new with using jQuery, and I needed to ask a question about get(). I know load works with what I'm doing, but I'm trying to wrap my brain around get(). Currently I have two pages on the same server, and on my first page I'm calling .get() the following way: $.get("http://server01/index.php?/runs/plot/39&format=outline", function(data) { console.log("Data Loaded: " + data); }); I'm running it that way just to test if the HTML grabbed is coming back correctly.
Changing a style adding a link
Currently on our website we have a products page. It uses default text links if the product is in stock, or if the products has options to choose from. If the product is out of stock then there is no link displayed. I have some jquery that changes the code so that the text links show up as images. However what I would like to do is if the item is out of stock to show another image. The way it works is that a style tag gets changed to hidden if it is out of stock so I'd have to change that style
Gtting the error "cannot call method 'hide' of undefined" when i am opening a page using JQuery
0 Hi, When I am opening a page using Jquery on click event I am getting the below error "cannot call method 'hide' of undefined" . More description about error: Uncaught TypeError: Cannot call method 'hide' of undefined N I b.fn.fancybox f.event.dispatch f.event.add.h.handle.i please help on this. Thanks and Regards Kranthi
http://api.jquery.com jsonp interface?
Hello all, I'm learning jQuery with the book "Learning jQuery 3rd edition". On chapter 13 dealing with advanced ajax request, the first example deals with JSONP request on the http://api.jquery.com site (to search for terms). Looking for the term "attr" in the example search box, the JSONP request fails (google chrome version 24). The following message appears in the console: GET http://api.jquery.com/jsonp/?callback=jQuery18307154251742176712_1358247669706&title=attr&_=1358247673264 404 (Not Found)
JqPlot - Does not show simple graph
Hi guys, I'm really new to Javascrip/Jquery/Jqplot and I'm trying to learn by myself. Then I have some questions, Is this code enough to show a simple graph? Because it's not working, it shows a blank page. <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Test</title> <script type="text/javascript" src="js/jqplot.canvasTextRenderer.min.js"></script> <script type="text/javascript" src="js/jqplot.canvasAxisLabelRenderer.min.js"></script> <script language="javascript">
what could be the json type for retrieving names from DB?
Hi, I am trying for autocomplete as given in http://jqueryui.com/autocomplete/#multiple-remote and i have done this way as shown in jsfiddle http://jsfiddle.net/9uMTQ/ Actually the way i am creating json is wrong because what ever you type in the search field,its giving only one value. Can anybody please tell me what would be the json types to get only names/ example john,jocky,james. so when you type jo it should display john and jocky
jquery json not working
Hi, I am new to jquery and was wandering for json use in ajax. I recently watched jQuery site Below is my source code but it's not working <!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>jQuery UI Autocomplete - Remote JSONP datasource</title> <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> <link
ReferenceError: desktop is not defined
Hi everyone, I've just started to implement jQuery into a website I'm working on, but I'm getting an error showing up in the Firebug console. "ReferenceError: desktop is not defined $(desktop).ready(function(){" I've been searching Google for ages, trying to find a solution. However it seems that no one has had this problem. There have been lots of "ReferenceError: $ is not defined" but nothing to do with "desktop". The site I'm working on is on localhost and consists of php pages with the header,
USE AUTOCOMPLETE FUNCTION IN SEARCH FORM
I would like to use the autocomplete widget as described in http://jqueryui.com/autocomplete/ It would be on a form that I have a search page. I am trying to use it with a search box that pulls back items from a text field. Has anyone seen a good example of where to place the code? Thanks in advance.
Using JQuery to simulate Button Click
I have some jQuery that is being run when the use clicks return. Basically I have an input box and a button. After the user adds some search criteria in the input box they can click return and start the search $("#searchvalue").keyup(function(event){ if(event.keyCode == 13){ if( !$('#searchvalue').val() ) { alert("Please Enter a Search Value"); } else{ window.location.href = "/search.php?ItemValue=" + $("#searchvalue").val(); } } }); <span id="SpanDepartment"><input id="searchvalue" type="text"
TypeError: a is null in MicrosoftAjax.js
Hi All, I am working with asp.net and when i run the sample it shows an error like "a is null" in MicrosoftAjax.js. I simply use a color picker in a grid item template. My code is as follows my scriptmanager have ScriptMode as Release. if i am not using release it returns Sys.ArgumentsNull error.. so i use release in script manager... <asp:ScriptManager ID="ScriptManager2" runat="server" ScriptMode="Release"> </asp:ScriptManager> CodeBehind: protected void GridGroupingControl1_QueryCellStyleInfo(object
div change background-position
Hello all , i have div with background image and some li so when i haver the li the background-position change have look in to code here HTML Code <div class="home-banner">
<ul class="services">
<li class="item-1"><a href="#">love</a></li>
<li class="item-2"><a href="#">love o</a></li>
<li class="item-3"><a href="#">love 2 <br> Marketing</a></li>
<li class="item-4"><a href="#">love 3 <br> Optimization</a></li>
<li class="item-5"><a href="#">love
Charset with Ajax method
Hi, I'm just starting with jQuery and I have a short question about the Ajax method. I've the following code: $.ajax({ url: "scriptx.php", contentType: 'application/x-www-form-urlencoded; charset=ISO-8859-1', beforeSend: function ( xhr ) { xhr.overrideMimeType("text/html; charset=ISO-8859-1"); }, data: { p : arg }, statusCode: { 404: function() { alert("page not found"); } }, success: function( data ) { $( ".content" ).empty(); $( ".content" ).html( data); } }).done(function()
can i use juery to change image on browser's resize?
Hello. I have a div w/an image. when the user resized the brower I'd like to have that image change to a smaller one. I know i can use the css @ media query for background images/css but is there a way to do that for the images placed in the html's divs? thank you D
jQuery static menu too much code
Hi, I just started with jQuery and I wanted to do a website with 4 menu buttons and after I click them only content div will change. So i did something but I have too many lines of code for this simple task. I hope somebody can explain me how to to thing more efficiently. This is my index.html page <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link type="text/css" rel="stylesheet" href="style.css"> <title>Rainer TestPage</title> <script
Question about fixed header table
I am trying to get this jquery plugin to work: http://fixedheadertable.com/ My code is as follows, but it is not working: HTML> <html> <head> <meta charset='utf-8'> <title>test</title> <link rel="stylesheet" type="text/css" href="main.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script> <script src="/js/jquery.fixedheadertable.js"></script> <script type="text/javascript"> $(document).ready(function()
onMousein and onMouseOut in a Menu
How can I do that in my example (http://jsfiddle.net/samuvk/sMqKA/14/) Place1 and Place2 only appear when sitting the mouse over the object "Places"? If possible I would like to display like this: Home Places Place1 Place2 Instead of Home Places Place1 Place2 Thank you so much
Table in Jquery
I would like to know how can I create a HTML table in JQuery. I would like to create a simple table like: <table bgcolor=white width="245"> <tr> <td> <font color=darkblue size=3>Category 1</font> <br> <font color=#1dc4ff size=2><a href="">Element 1</a></font> <br> <font color=#1dc4ff size=2><a href="">Element 2</a></font> </td> </tr> </table> In something that I can code in my .jsp file. Something like: (function( $ ) { $.fn.MyTable = function(options) { }); }; And how should I
GetDayNumberFromName and show item from Sharepoint list
Hi guys, I'm pretty new in jquery, and would like your help. I've created a list in Sharepoint, like a restaurant menu, so I would like to enable the menu related to the date "name". I can actually set the first item from list i would like to start, using: $('div.ms-ppleft table tr td.ms-vb-title').first().trigger('onfocus'); }) // related to Monday $('div.ms-ppleft table tr td.ms-vb-title').second().trigger('onfocus'); }) // related to Tuesday $('div.ms-ppleft table tr td.ms-vb-title').third().trigger('onfocus');
How to delete an array of object entry?
Hi, I'm trying to delete an item of a collection (is that the real name of it?) and I can't find how do it. The JsFiddle page : http://jsfiddle.net/hsolatges/c8YVH/ The user enter some new series ({serie: myseriename, data: mydata}). Flot replot the graph. How make possible for the user to delete any of those series and update the graph ? The newbie I am can't find a nice way to search in my data array (dt) and delete the right entry. Thanks ! PS : what is the name of the object {{serie: myseriename0,
Next Page