Search Results

Search found 23820 results on 953 pages for 'jquery ui autocomplete'.

Page 165/953 | < Previous Page | 161 162 163 164 165 166 167 168 169 170 171 172  | Next Page >

  • jQuery hide/show div using variables

    - by user295927
    I am a nOOb to jQuery. I want to use variables in jQuery to hide/show divs. what I have so far is: $(document).ready(function(){ $('#listMenu a').click(function () { var getPage = $(this).attr("id"); var getName = $(this).attr("name"); //console.log(getPage); //console.log(getName); $("#" & getName ).show(); }); }); firebug console shows that I have the vars correctly, but I get this error next: this[H].style is undefined [Break on this error] (function(){var R=/((?:((?:([^()]+)...typeof K==="string"?K:K+"px")}})})(); any help is appreciated. sjs

    Read the article

  • jQuery: Post form to a modal window for previewing the entered data

    - by superUntitled
    I am looking for a way to use jQuery to allow a user to look at a modal window "preview" of a form before they submit the form to be saved. I have this working with javascript, the form is posted to a file named preview.php that iterates through the posted information. The script currently opens a new window. I would like instead to use jQuery to post the form to a modal window for previewing. Does anyone have any thoughts on how to do this? This is what I am currently using: <script language="JavaScript"> function preview(form) { form.target='_blank'; form.action='http://example.com/preview.php'; form.submit(); } </script> <input type="button" value="preview" onclick='preview(this.form)'>

    Read the article

  • How to use JQuery to remove dynamic content?

    - by ed.talmadge
    I have an html page that is generated by a CMS. I cannot modify the page, but can add JavaScript. Each time the page loads, a JavaScript function (that I cannot modify) dynamically inserts a paragraph onto the page. How can I use JQuery to .remove() that paragraph whenever it is loaded? For example, when the page first loads, it look like this (blank): <div></div> Then, a few seconds later, a JavaScript function (that I have no control over) adds a paragraph to the page. The page then looks like this: <div><p id="foo">bar</p></div> How can I use JQuery to remove the paragraph with id=foo each time it is dynamically loaded onto the page?

    Read the article

  • best way to filter out non-representational elements

    - by nonano
    Hi there, I am using phpQuery in order to apply some twaks to editorial content. As its syntax is the same as jQuery, I consider this a dom scripting issue. To get rid of elements which are not representing anything, but wrapping other stuff (like the div in <div><p>blah</p></div> I came up with this selector: ['div:not([align][class][id][style][title][dir][lang][onclick][ondblclick][onmousedown] [onmouseup][onmouseover][onmousemove][onmouseout][onkeypress][onkeydown][onkeyup])'] which looks quite monstrous for a selector simply aming on Divs which just do not have any (valid) attribute. I guess there must be a more straight-forward way to accomplish that, right? Edit: Oh, and I just noticed that it even doesn't do wat I intended to ...

    Read the article

  • How to show the animation without exposing the code?

    - by bonCodigo
    There's an animation done in jQuery within jsfiddle. I do not have a website as of now to "implant" it and share the URL. I also can't give the jsfiddle. So how can I share my animation to the audience without showing the code? Does github or any other facility tools allow locking the code and showing the final product without having a website, yet I could get a URL for the audience to view it? I regret for the rookie-question in this context as I am still new to web stuff. EDIT: jsFiddle shows 3 code windows along the results :html, css, js. My requirement is to only show the results window to the audience and by all means to hide codes and leads via URL to the codes. Ideal solution demands a results to be shown and URL that is encrypted (at best).

    Read the article

  • JQuery hide div based on day

    - by Ryan
    I'm trying to hide a div based on the day of week? <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script> <script type="text/javascript"> var rightNow = new Date(); var day = rightNow.getUTCDay(); if (day = 5;) { $('#friday').hide(); } </script> <div id='friday'> friday </div> <br> <div id='saturday'> saturday </div> <br> <div id='sunday'> sunday </div> <br> <div id='monday'> monday </div>

    Read the article

  • why does calling methods on a div fire the live click event

    - by oo
    i have this jquery code: $(this).parent('.copyFoodInstance').attr("myset", "0"); $(this).parent('.copyFoodInstance').html("<img BORDER=0 src='../../images/copy1.png' />"); it seems that when i call this code, this event fires: $(document).ready(function() { $('div.copyFoodInstance').live('click', function() { does anyone know why this event fires from the lines above? is there anyway to stop if from firing? All i am doing is updating an attribute on the div and updating the html. this shouldn't fire a click event?

    Read the article

  • How to retrieve the real height of a #div (including overflowed parts)

    - by Toni Michel Caubet
    The same way i use this to detect when user scolled down the whole page: $(window).scroll(function(){ var diff = $(window).scrollTop() + $(window).height() - $(document).height(); if ($(window).scrollTop() == $(document).height() - $(window).height() || (diff < 5 && diff > -5)){ console.log('yay!'); } }); I wanted to do the same inside a dialog, I am trying like this: $('#dialog').dialog(); $('#dialog').scroll(function(){ var scroll = $('#dialog').scrollTop(); var height = $('#dialog ul').outerHeight(true); if(scroll == height){ $('#dialog').css('background','#999'); }else{ console.log('scrolltop is '+scroll+' and height is: '+height); } }) DEMO: http://jsfiddle.net/AgFXz/ The problem i guess is that i am not retrieving the whole #dialog size but the visible (CSS Defined property) size.. How can i know when user scrolled till the end of the dialog's scroll? Thanks!!

    Read the article

  • Opening all external links in Phongap's ChildBrowser using jQuery Mobile

    - by Adam
    I'm using jQuery Mobile & Phonegap, and have the following code to open all external links in a certain div with the ChildBrowser: $('.someDIV a').live('click', function() { var thisUrl = $(this).attr('href'); PhoneGap.exec("ChildBrowserCommand.showWebPage", thisUrl); return false; }); For some reason, while the page loads in the childbrowser, it also loads in the background, as if there's no "return false". I've found a workaround by giving the link's href attribute a value of "#", and using the title for the url like this: And updating the jQuery code accordingly, but this is a problem where my links are dynamically generated, and I can't have the url in the title attribute. Any ideas how to solve this?

    Read the article

  • Access asp:CheckBox inner input from jQuery

    - by abatishchev
    I have a jQuery array acting on each control having corresponding class: function Foobar() { $('.foo').each(function() { // do something with $(this) } } I can access client-side controls like <input class="foo"> and server-side controls like asp:TextBox CassClass="foo"> But setting CssClass for asp:RadioButton doesn't make a sense. Here is generated code: <span class="foo"> <input type="radio" /> </span> How to set class for inner input or another way gather it using jQuery?

    Read the article

  • jquery json function returning null

    - by ian
    I have a jquery script as below: $.ajax({ type: "GET", url: "http://www.site.com/v4/ajax/get_song_info.php", data: ({id : song_id }), dataType: "json", success: function(data) { alert( "Data: " + data ); } }); And the associated php page: <?php include_once '../connect.php'; $song_id = $_GET['id']; $query = mysql_query("SELECT * FROM songs WHERE id = '$song_id' LIMIT 1"); $song = mysql_fetch_row($query); $song_info = array( htmlentities($song[3]) , htmlentities($song[4]) ); header('Content-Type: application/json'); echo json_encode($song_info); ?> The php returns something like this when I call it on its own in a browser: ["Peaches","I Feel Cream (Proxy Remix)"] However when I make the jQuery call my alert shows 'Data: null'

    Read the article

  • Using jQUery hide() on newly created dom elements

    - by WeaponsTheyFear
    I am relatively new to jQuery. What I have is an app that is displaying a list of content items from the database in a table. If I click the title link of the page, it will load the page to edit in a tab (clicking teh tab lets me view that form to edit). My problem is that in using .load and creating the html inside an empty div, my css that was previously hidden by jQuery is no longer being hidden in this new form. For example, on the same page, I have a div with the class error. This is hidden. I click the title to edit, the page loads in an empty div, and the divs with error as a class are not hidden. Is there a way around this to get these elements hidden?

    Read the article

  • jQuery jqXHR - cancel chained calls, trigger error chain

    - by m0sa
    I am creating a ajax utility for interfacing with my server methods. I would like to leverage jQuery 1.5+ deferred methods from the object returned from the jQuery.ajax() call. The situation is following. The serverside method always returns a JSON object: { success: true|false, data: ... } The client-side utility initiates the ajax call like this var jqxhr = $.ajax({ ... }); And the problem area: jqxhr.success(function(data, textStatus, xhr) { if(!data || !data.success) { ???? // abort processing, trigger error } }); return jqxhr; // return to caller so he can attach his own handlers So the question is how to cancel invocation of all the callers appended success callbacks an trigger his error handler in the place mentioned with ???? ? The documentation says the deferred function invocation lists are FIFO, so my success handler is definitely the first one.

    Read the article

  • Best strategy for HTML parcial rendering based on multiple dropdown values

    - by pv2008
    I have a View that renders something like this: "Item 1" and "Item 2" are <tr> elements from a table. After the user change "Value 1" or "Value 2" I would like to call a Controller and put the result (some HTML snippet) in the div marked as "Result of...". I have some vague notions of JQuery. I know how to bind to the onchage event of the Select element, and call the $.ajax() function, for example. But I wonder if this can be achieved in a more efficient way in ASP.NET MVC2.

    Read the article

  • jQuery: use Use filter(), but work with both results

    - by Tomalak
    In jQuery, filter() reduces your result to those elements that fulfill a certain condition. This splits the list in two parts. Working with the "good half" of the elements is easy: $("some selector").filter(function() { // determine result... return result; }).each( /* do something */ ); But how can I work with the "other half" of my elements, too - but without doing the equivalent of this: $("some selector").filter(function() { // determine result... return !result; }).each( /* do something else */ ); Basically, I'd like to feed two separate /* do something */ parts to a single filter. One for those that match, and one for the others - without having to filter twice. Am I missing a jQuery function that does this? P.S.: I guess I could do: $("some selector").each(function() { // determine result... if (result) /* do something */ else /* do something else */ }); But I was hoping for something nicer.

    Read the article

  • how to get reply from jQuery.get request

    - by BCS
    I have a page that uses the following to submit a AJAX request: function oc() { jQuery.get( "http://somewhere.com:5001/ajax/options/", jQuery('#selectform').serialize(), function(data,statusm,xml){ // I got nothing!!! return; } ); } If I make the request manual from the address bar, things work. And when I make the request from the JS I can see via logging that the server side is working correctly, but in the call back, I can't seem to get the contents of the reply. What am I going wrong?

    Read the article

  • any simple jquery <table> paginators

    - by Mike
    I'm looking for a jquery plugin so I can paginate my html tables (the content of which is generated by a jsp c:forEach). But so far I haven't found anything that worked. The plugin doesn't need to be fancy, in fact something like the first example on http://dl.dropbox.com/u/4151695/html/pajinate-0.2/examples/example1.html would do fine. I'm still very new to jquery so I don't have the knowledge yet to write one myself. So does anyone have any pointers where I could find one?

    Read the article

  • How to close jQuery Dialog within the dialog?

    - by imperialx
    Hello, How to close jQuery Dialog within the dialog without using the close button? Inside the ui dialog is a simply form request and if a successful submission occurs, then the ui dialog automatically closes and refreshes the parent page. <script type="text/javascript"> $(document).ready(function () { $("#form-dialog").dialog({ autoOpen: true, modal: true, width: 200, draggable: true, resizable: true }); }); </script> <div id="form-dialog" title="Form Submit"> <form action="default.aspx" method="post"> <input type="text" name="name" value=" " /> <input type="submit" value="submit" /> </form> </div> -imperialx

    Read the article

  • reorder list elements - jQuery?

    - by Alex
    Hello, I am experimenting with jQuery lately, and I was wondering if it's possible with js or pure jquery to reorder <li> elements. So if I have a silly list like the following: <ul> <li>Foo</li> <li>Bar</li> <li>Cheese</li> </ul> How would I move the list elements around? Like put the list element with Cheese before the list element with Foo or move Foo to after Bar. So is it possible? If so, how? Thanks!!

    Read the article

  • PHP File Upload + jQuery

    - by st4ck0v3rfl0w
    Hello Everyone, So I have my upload script working just fine, but now it's a matter of making it look the way I want for my layout. <input type="file" name="userfile" id="userfile"/> This obviously shows a textbox with a Choose File button. What I really need is my own custom button (which will ultimately be an image) that upon successful file select (not upload quite yet) triggers a jQuery event to show a div. I do NOT want the filename textbox to show. Basic steps outlined below. User clicks on image button to upload their file User selects file jQuery shows a div with more fields User clicks submit and file is uploaded

    Read the article

  • How to add space after elements added via jQuery

    - by ahsteele
    I am rendering a similar construct to the below with some server side code. The server side code inserts hard returns in between the project label and text fields. Not a big deal except the below jQuery code inserts the project label and text fields mashed together. var projectLabel = $('<label for="project">Project</label>'); var projectField = $('<input type="text" name="project" id="projectName" />'); projectLabel.insertBefore($(this)); projectField.insertBefore($(this)); Because of this discrepancy the elements rendered server side have a space between them while the ones rendered on the client do not. I've tried adding a nbsp; at the end of each line to no avail. Unfortunately, I have been unable to remove the hard returns outputted by the server side code. Further because of the space I can't fix this with CSS. What are my options for adding spacing via jQuery?

    Read the article

  • Override default javascript functionality with jQuery

    - by deth4uall
    I am trying to overwrite a JavaScript on change event in the below code with jQuery however I believe that the inline JavaScript is taking priority over the jQuery functionality declared. Essentially I am trying to have an AJAX version of my site which includes an additional JavaScript file. I need this functionality to still work without the additional AJAX version, but I am not sure as to whether I should include it in the main JavaScript file or leave it inline like it is right now. Any suggestions and information regarding them would be greatly appreciated! Thanks! <form action="/cityhall/villages/" method="post" name="submit_village"> <select name="village" onchange="document.submit_village.submit();"> <option value=""></option> </select> </form> I am trying to use the jQuery Form Plugin to submit the posts to the PHP to handle the requests as follows: var bank_load_options = { target: '#content', beforeSubmit: showRequest, success: showResponse }; $('form.get_pages').livequery(function(){ $(this).ajaxForm(bank_load_options); return false; }); I modified the code as following: <form action="/cityhall/villages/" method="post" id="submit_village" name="submit_village"> <select name="village" class="get_pages" rel="submit_village"> <option value=""></option> </select> </form> <script> # main JavaScript $('.get_pages').live('change',function(e){ var submit_page = $(this).attr('rel'); $("#"+submit_page).submit(); }); # ajax JavaScript var bank_load_options = { target: '#content', beforeSubmit: showRequest, success: showResponse }; $('.get_pages').live('change',function(){ var submit_page = $(this).attr('rel'); $("#"+submit_page).ajaxForm(get_pages_load_options); return false; }); </script> However now it only runs every other option when I change it.

    Read the article

< Previous Page | 161 162 163 164 165 166 167 168 169 170 171 172  | Next Page >