Search Results

Search found 17637 results on 706 pages for 'jquery autocomplete'.

Page 29/706 | < Previous Page | 25 26 27 28 29 30 31 32 33 34 35 36  | Next Page >

  • alternative to JQuery form.submit() to do ajax post

    - by BluntTool
    Hello, I have a mvc2 application with a view like this <% using (Ajax.BeginForm("UserApprove", new { id = Model.id }, new AjaxOptions() { UpdateTargetId = "statusLights", OnSuccess = "HideButtons" }, new { id = "UserApprove" })) {%> <input type="button" value="Approve" onclick="$('#dialogApprove').dialog('open')" /> <div id="dialogApprove" title="Confirm"> <p> Are you sure you want to approve this request? </p> </div> <% } %> FYI, the controller returns a partial view back. I used to not have the jquery dialog and just simple a <input type="Submit" value="Approve" /> that used to work fine I added the jquery dialog and I have something like this to initialize the dialog. $("#dialogApprove").dialog({ autoOpen: false, draggable: true, resizable: false, buttons: { "Cancel": function() { $(this).dialog("close") }, "Approve": function() { $("#UserApprove").submit(); $(this).dialog("close"); } } }); The $("#UserApprove").submit(); does not seem to be doing an ajax post. It comes back with just the text from the partial view returned in a new page. I dont want to use the jquery form plugin which has .ajaxSubmit(). Is there any other way to force an ajax post from the jquery dialog "approve" button?

    Read the article

  • Finding usage of jQuery UI in a big ugly codebase

    - by Daniel Magliola
    I've recently inherited the maintenance of a big, ugly codebase for a production website. Poke your eyes out ugly. And though it's big, it's mostly PHP code, it doesn't have much JS, besides a few "ajaxy" things in the UI. Our main current problem is that the site is just too heavy. Homepage weighs in at 1.6 Mb currently, so I'm trying to clean some stuff out. One of the main wasters is that every single page includes the jQuery UI library, but I don't think it's used at all. It's definitely not being used in the homepage and in most pages, so I want to only include the where necessary. I'm not really experienced with jQuery, i'm more of a Prototype guy, so I'm wondering. Is there anything I could search for that'd let me know where jQuery UI is being used? What i'm looking for is "common strings", component names, etc For example, if this was scriptaculous, i'd look for things like "Draggable", "Effect", etc. Any suggestions for jQuery UI? (Of course, if you can think of a more robust way of removing the tag from pages that don't use it without breaking everything, I'd love to hear about it) Thanks!! Daniel

    Read the article

  • Jquery UI modal dialogs

    - by Anonymous user
    Hi All. I have a problem with Jquery UI modal dialogs. I have modal dialog (dialogA), which can create another modal dialog (dialogB). After the second creation and closure of the dialogB the overlay of dialogA disappear. Here is my code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head><link type="text/css" rel="Stylesheet" href="ui-lightness/jquery-ui-1.8.custom.css" /> <script type="text/javascript" src="jquery-1.4.2.min.js"></script> <script type="text/javascript" src="jquery-ui-1.8.custom.min.js"></script> <script type="text/javascript"> function createDialog(dialogId) { $('#' + dialogId).dialog({ autoOpen: true, modal: true, buttons: { 'close': function() { $(this).dialog('close'); }, 'create': function() { var newDialogId = dialogId + '1'; $('body').append('<div id="' + newDialogId + '">' + newDialogId + '</div>'); createDialog(newDialogId); } }, close: function() { $(this).dialog('destroy'); $(this).remove(); } }); } $(document).ready(function() { $('#button1').click(function() { var dialogId = 'dialog'; $('body').append('<div id="' + dialogId + '">' + dialogId + '</div>'); createDialog(dialogId); }); }); </script> </head> <body> <button id="button1">Create dialog</button> </body> </html> Thanks

    Read the article

  • jQuery multiple themes on one page

    - by lloydphillips
    This is driving me NUTS! I've followed the post here which just doesn't seem to be working: http://www.filamentgroup.com/lab/using_multiple_jquery_ui_themes_on_a_single_page/ I have a base theme, for examples sake it's the Smoothness theme from the jQuery UI gallery. Then I have a 'red' theme which basically colours the buttons red. Here is the theme I created. So I go to download my theme. Choose Advanced settings, set the scope to 'red' and my theme folder name to 'red' and download. First of all I'm not entirely 100% sure which folder I'm to copy over to my project is it the 'development-bundle\themes' folder (which contains my red folder) or the '\css\red' folder? I've tried both. The post above seems to suggest if I copy my themes folder and link to my theme in the css it'll work when I add a class of 'red' to a wrapper div or element. So I've linked the themes like so in my file: <link type="text/css" href="themes/base/jquery.ui.all.css" rel="stylesheet" /> <link type="text/css" href="themes/red/jquery.ui.all.css" rel="stylesheet" /> The base theme loads and works all honkey doorey but the red theme doesn't. I've got a button styled like so: <input type="submit" id="btn" value="A submit button" class="red" /> I've also tried: <div class="red"> <input type="submit" id="btn" value="A submit button" /> </div> Neither work. When I remove the 'themes/base/jquery.ui.all.css' css file link the button's aren't styled at all. Crazy! I'm pulling my hair out. Where am I going wrong? Surely they should just make it easy enough to download JUST the theme folder and reference the ui.all file.

    Read the article

  • Unable to run jQuery Masonry in a Sencha Touch 2 app

    - by torr
    In my ST2 app I have on index.html <script id="jquery" type="text/javascript" src="resources/js/jquery-1.8.2.js"></script> <script id="masonry" type="text/javascript" src="resources/js/masonry-2.1.5.js"></script> as well as <script> $(document).ready(function(){ var $container = $('.x-list-container'); $container.imagesLoaded(function(){ $container.masonry({ itemSelector: '.x-list-item', }); }); }); </script> My front page on the app is a list so it wraps elements as such <div class="x-list-container"> <div class="x-list-item"></div> // 'x-list-item' is the block I want to float <div class="x-list-item"></div> ... </div> However once everything is loaded and I inspect .x-list-item there is no style positioning the div. I am experience with Masonry on regular web app but can;t make it work here. It's like Masonry isn't running at all. It is being loaded (checked on the network tab) and jQuery is being loaded (on network tab and tested using if (jQuery) {alert('hey there');. Any idea what I'm doing wrong? }

    Read the article

  • How to link jQuery UI datepicker functionality with a select list

    - by take2
    I'm trying to connect jQuery UI's datepicker with a select list. I have found one explanation on jQuery's Forum ( forum.jquery.com/topic/jquery-ui-datepicker-with-select-lists), but I can't get it working. There are input and select list both declared: <select id="selectMonth"><option value="01">Jan</option><option value="02">Feb</option> <option value="03">Mar</option><option value="04">Apr</option>...</select> <select id="selectDay"><option value="01">1</option><option value="02">2</option> <option value="03">3</option><option value="04">4</option>...</select> <select id="selectYear"><option value="2012">2012</option><option value="2013">2013</option> <option value="2014">2014</option>...</select> <p>Date: <input type="text" id="selectedDatepicker" /></p> This is the script: $(function() { $('#selectedDatepicker').datepicker({ beforeShow: readSelected, onSelect: updateSelected, minDate: new Date(2012, 1 - 1, 1), maxDate: new Date(2014, 12 - 1, 31), showOn: 'both', buttonImageOnly: true, buttonImage: 'img/calendar.gif'}); // Prepare to show a date picker linked to three select controls function readSelected() { $('#selectedDatepicker').val($('#selectMonth').val() + '/' + $('#selectDay').val() + '/' + $('#selectYear').val()); return {}; } // Update three select controls to match a date picker selection function updateSelected(date) { $('#selectMonth').val(date.substring(0, 2)); $('#selectDay').val(date.substring(3, 5)); $('#selectYear').val(date.substring(6, 10)); } }); And here is the fiddle: http://jsfiddle.net/xKXZm/ They are not connected properly, the only "connected behaviour" is that when you click on the input button, it picks up the value of the select list. On the other hand, the select list never picks up the value of the input nor will the input pick up the value of the select list until you click on it.

    Read the article

  • how to execute any function in jquery after few seconds on the click of any link

    - by james Bond
    I have struts2 jquery grid where on click of a row I am calling a jQuery function for performating a struts2 action. My code is running fine. I want to perform my jQuery function after delay of a few seconds. How can I do this? <script type="text/javascript"> //assume this code is working fine on rowselect from my jquery grid, New Updation in it is "i want to execute or load the url after few seconds" $(function(){ $.subscribe('rowselect', function(event,data) { var param = (event.originalEvent.id); $("#myAdvanceDivBoxx").load('<s:url action='InsertbooksToSession' namespace='/admin/setups/secure/jspHomepage/bookstransaction'/>'+"?bid="+event.originalEvent.id); }); }); </script> What i tried is the below code but am unable to get the output which i am looking for: <script type="text/javascript"> $(function(){ $.subscribe('rowselect', function(event,data) { var param = (event.originalEvent.id); $("#myAdvanceDivBoxx").load('<s:url action='InsertbooksToSession' namespace='/admin/setups/secure/jspHomepage/bookstransaction'/>'+"?bid="+event.originalEvent.id); }).delay(9000); }); </script>

    Read the article

  • jquery mobile - loading content into a div

    - by Robbiegod
    Jquery Mobile works by “hijacking” a page and loading content and injecting it into the page. It seems that this creates a problem when i try to inject other content into the page. I have my index.html and then a page2.html file. I'm setting up jquery mobile in the normal fashion wrapping the contents of each page in a div like so: <div id="container" data-role="page"> // my content <a href="page2.html">go to page 2</a> </div> when the user taps go to page 2, it does the nice slide effect. The url in the location bar looks like this: index.html#page2.html jquery mobile inject the content of the page using the anchors and applies the transition. nice so everthing works great up to the next part. On page2.html, i have a section that is loading some external data and injecting it into a div. <a href="http://www.somedomain.com/myata.php" class="ajaxtrigger" data-role="none">mydata</a> <div id="target"></div> <script src="js/code.js"></script> <script src="js/loader.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('.ajaxtrigger').trigger('click'); }); </script> The problem i am having is that when i enable the transitions in jquery mobile this script doesn't work. It won't load the data into the div. bummer. Anyone know what i need to do to get it to trigger and load the content into that div?

    Read the article

  • Jquery plugin seems to leak memory no matter what I do

    - by ddombrow
    I've recently been tasked with ferreting out some memory leaks in an application for my work. I've narrowed down one of the big leaks to a jquery plugin. It appears we're using a modified version of a popular context menu jquery plugin. It looks like one of the developers before me attempted to add a destroy method. I noticed it wasn't very well written and attempted to rewrite. Here's the meat of my destroy method: if (menu.childMenus) { for (var i = 0; i < menu.childMenus.length; i++) { $(menu.childMenus[i]).destroy(menu.childMenus[i], 'contextmenu'); } } var recursiveUnbind = function(node) { $(node).unbind(); //$(node).empty().remove(); $.each(node, function(obj) { recursiveUnbind(obj); }); }; $.each(menu, function() { recursiveUnbind(menu); }); $(menu).empty().remove(); In my mind this code should blow away all the jquery event binding and remove the dom elements, yet still the plugin leaks gobs of memory in IE7. The modified plugin with a test page can be found here: http://www.olduglyhead.com/jquery/leaks/ Clicking the button repeatedly will cause IE7 to leak a bunch of memory.

    Read the article

  • Love and Hate Outlook autocomplete, Outlook 2010/Exchange 2010

    - by Kay Sellenrode
    I think that almost every Exchange admin can concur with me that the Outlook autocomplete cache is one of those things you love but at the same time also hate. Users mostly love this function, except when it fails.Luckily since Outlook 2010 things got a little better and we got rid of the dreaded nk2 files.Outlook 2010 now includes a folder named "Suggested Contacts", all users you send an email to and that don't already have an contact object are saved in this suggested contacts folder.A lot of people thought this folder is also the source for the autocomplete cache, which would make it somewhat easy to manage, I wish the solution was that easy.Badly enough separate from the suggested contacts, outlook still maintains a cache for the autocomplete function. Let us say you run in to the following situation: John works for company A and is a popular contact for almost everyone in your organization.Now John quit his job at Company A and moved to Company B.Luckily John maintains your company as customer, but his email address is now changed from companyA.com to companyB.comSince you don't want to do any business with Company A anymore, you want to make sure none of your users accidentally mail to his old address.Now this is where the real fun starts, cause almost all of your 1000 users have mailed at least once with John.Resulting in the fact that every user has John most probably listed in their autocomplete cache.  I have run into sort like situations multiple times with several customers, which is always a pain.And of course this blog post is the result of one of those issues once again.I knew that with the Suggested contacts we could do more than previously, but still never spent time on it before.But today I thought lets nail this now and forever!!  Ok let's start of that things are different for every combination of outlook and exchange.I explain the procedure for Exchange 2010 SP1+ in combination with Outlook 2010.At first we want to get rid of all contact objects that contain [email protected] do this we need to be assigned to the RBAC role "Mailbox Import Export", which can be done through the Exchange Control panel.In my test environment I assigned this role to the Organization admins, but in real life you might want to add it to a custom role. Open the Exchange control panel by logging in to the ecp url, in my case https://ITFEX.itf.local/ECP, and make sure you selected your organization as management scope.Browse to Roles & Auditing, and open the properties for the organization management role group.click on the Add button to add a new role to the Organization Management role group, select the Mailbox Import Export role and click on add and OK to add it to the role.  Once you have assigned that role to your account you can open the Exchange Management Shell and execute the following command: Get-mailbox –resultsize unlimited | search-mailbox –targetmailbox "your.account" –targetfolder searchanddelete –loglevel full –logonly –searchquery "kind:contact AND [email protected]" This command will create a list with all mailboxes and any contacts that were found with an email address that contains [email protected], this list is then posted in the mailbox you specified at your.account in the folder searchanddelete.Now examine the report that was created and posted in the mailbox to see if it matches what you think it should match.My results looked like this:  When you're confident that the search includes all references and no false positives you can execute almost the same command, but this time with an delete action instead of the logonly. Get-mailbox –resultsize unlimited | search-mailbox –targetmailbox "your.account" –targetfolder searchanddelete –loglevel full –DeleteContent –searchquery "kind:contact AND [email protected]" Now most people would think this would remove the contact object from the suggested contacts, resulting in a removal from the autocomplete list.Sad but not true, to clean up the autocomplete list start Outlook with the command: "outlook /cleanautocompletecache" This will result in an empty cache, but luckily this is rebuild based on the suggested contacts, which now doesn't include the [email protected] contact anymore.

    Read the article

  • Ajax Autocomplete Extender

    - by Jason Ulloa
    El objetivo de este post es preparar un ejemplo sobre un tema que es planteado muy frecuentemente en los Foros de MSDN, como realizar un Autocomplete contra una base de datos. Qué requerimos? Antes de poder realizar un Autocomplete debemos tener en cuenta los elementos principales que requerimos para poder hacerlo funcionar, descritos de la siguiente manera: 1. Textbox: Nuestro grandioso amigo Textbox, que será donde el usuario ingresará los datos a buscar. 2. Un Webservice: que contendrá el método que se conectara a la base de datos y devolverá una lista con la información encontrada. 3. Ajax Autocomplete Extender: este es por decirlo así, el elemento más importante. Nos servirá como medio de enlace entre el webservice que expone el método y el textbox recuperando y mostrando los datos en forma de lista desplegable. La implementación Si bien parecierá complicado, crear un autocomplete extender es bastante sencillo. Empezaremos creando un nuevo sitio asp.net, en este sitio agregaremos un textbox y dos controles muy importantes de Ajax el ToolkitScriptManager para controlar el rende rizado de los script de ajax y el AutocompleteExtender que, como mencione anteriormente, será el medio de enlace. Antes de mostrar como quedará el código de lo anterior, explicaré algunas propiedades del AutocompleteExtender para que se entienda de mejor manera: 1. El ServicePath: contiene la ruta relativa al webservice que utilizaremos. 2. MinimumPrefixLength: se refiere al número de caracteres que deben ser digitados antes de iniciar la búsqueda. 3. ServiceMethod: el nombre del metodo de nuestro webservice que se encargará de devolver los datos. 4. EnableCaching: para mantener en cache los datos consultados, obteniendo mayor velocidad. 5. TargetControlID: una de las propiedades más importantes, acá se coloca el nombre del textbox al cual se unirá el Autocomplete 6. CompletionInterval: tiempo que debe transcurrir antes de iniciar con el trabajo de los datos. Una vez, explicadas las propiedades básicas, veamos como queda implementada la primer parte de nuestro autocomplete: <form id="form1" runat="server"> <div> <asp:ToolkitScriptManager ID="manager" runat="server" /> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <asp:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" ServicePath="WebService.asmx" MinimumPrefixLength="1" ServiceMethod="PersonasInfo " EnableCaching="true" TargetControlID="TextBox1" UseContextKey="True" CompletionSetCount="10" CompletionInterval="0"> </asp:AutoCompleteExtender> </div> </form>   Ahora que nuestro código html está completo, es hora de trabajar directamente con nuestro webservice, este deberá contener un método que devuelva una lista o arreglo de datos, los cuales por supuesto, serán traídos desde la base de datos. Antes de implementar este método, debemos asegurarnos de que nuestra clase del webservice tiene habilitados los espacios para ser utilizada [System.Web.Script.Services.ScriptService()] [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] public class WebService : System.Web.Services.WebService {}   Ahora si, nuestro metodo principal [WebMethod()] [System.Web.Script.Services.ScriptMethod()] public string[] PersonasInfo(string prefixText, int count) { string connstring = ConfigurationManager.ConnectionStrings["LocalSqlServer"].ConnectionString;   using (SqlConnection conn = new SqlConnection(connstring)) { SqlCommand comando = new SqlCommand("select nombre from personas where nombre LIKE '%' + @param + '%' ", conn); comando.Parameters.AddWithValue("@param", prefixText); SqlDataReader dr = default(SqlDataReader); comando.Connection.Open(); dr = comando.ExecuteReader(); List<string> items = new List<string>();   while (dr.Read()) { items.Add(dr["nombre"].ToString()); } comando.Connection.Close(); return items.ToArray(); } }   Del método anterior no explicaré en profundidad, pues es bastante sencillo. Una consulta a la base de datos utilizando un datareader y devolviendo los datos en una lista como arreglo. Lo más importante serían las 2 primeras líneas [WebMethod()] y el [ScriptMethod()] las cuales habilitan nuestro método para poder ser accedido y utilizado. Por último, el código de ejemplo en C# (VB Autcomplete):

    Read the article

  • issues horizontal scrolling using jQuery.ScrollTo / jQuery.SerialScroll

    - by kapil.israni
    Hi, I am trying to develop auto horizontal scrolling for our website using - jQuery.ScrollTo / jQuery.SerialScroll. I am not sure if this is the best jquery library to do that, but if there's something better, please let me know. Here's the behavior that I want, check out foursquare's "Recent Activity" list. The data that will refresh will come from a ajax request that I make every few seconds using window.setInterval. I am not really a CSS/java script guy so I havent been able to figure out jQuery.SerialScroll. Here's the website - look at the "Live job Feeds" list. Currently the list does refresh the data coming from the ajax call, but I dont see the effect, the animation, in fact I dont even think serialScroll is being used. Right now I am doing a - $('#feed-ticker').prepend(content) to pre-append the newly arrived data. You can do a view source to look at the current code. Any help would be really appreciated. Thanks.

    Read the article

  • issues with horizontal scrolling using jQuery.ScrollTo / jQuery.SerialScroll

    - by kapil.israni
    Hi, I am trying to develop auto horizontal scrolling for our website using - jQuery.ScrollTo / jQuery.SerialScroll. I am not sure if this is the best jquery library to do that, but if there's something better, please let me know. Here's the behavior that I want, check out foursquare's "Recent Activity" list. The data that will refresh will come from a ajax request that I make every few seconds using window.setInterval. I am not really a CSS/java script guy so I havent been able to figure out jQuery.SerialScroll. Here's the website - look at the "Live job Feeds" list. Currently the list does refresh the data coming from the ajax call, but I dont see the effect, the animation, in fact I dont even think serialScroll is being used. Right now I am doing a - $('#feed-ticker').prepend(content) to pre-append the newly arrived data. You can do a view source to look at the current code. Any help would be really appreciated. Thanks.

    Read the article

  • Jquery TimePicker : How to dynamically change parameters

    - by mad.geek
    I am using a Jquery Timepicker . I have two input fields - to Accept times . <input id="startTime" size="30" type="text" /> <input id="endTime" size="30" type="text" /> I am using a Jquery UI timer as per documentation here - http://jonthornton.github.com/jquery-timepicker/ $('#startTime').timepicker({ 'minTime': '6:00am', 'maxTime': '11:30pm', 'onSelect': function() { //change the 'minTime parameter of #endTime <--- how do I do this ? } }); $('#endTime').timepicker({ 'minTime': '2:00pm', 'maxTime': '11:30pm', 'showDuration': true }); I want that when the first timePicker is selected , the 'minTime' parameter for the second gets changed . Basically I am trying to collect the start time and end time for certain activity . And I want that the second input box shows the options from the value of the first input field (start time ) itself .

    Read the article

  • jQuery.ajax checking if there is already another xhr

    - by digitalFresh
    I have a page when, if the user is near the bottom of the page, loads the next page. I just recently switched it to jQuery, and now use the jQuery.ajax() function to get the data. However, now i cannot check if the xhr is already loading, making the page load multiple xhrs when the user near the bottom. My listener is: $(document).scroll(function () { if(/* scrollbar is near bottom */) loadxhr(dat++); //function that calls jQuery.ajax() } }); Basically, can you track the readyState of the call in a global scope?

    Read the article

  • jQuery UI Draggable-Droppable overflow:visible

    - by Jeff
    Sadly, I am unable to provide any JSFiddle for this issue, as I cant seem to reproduce it outside my project. I have a container where there are some boxes, that can be arranged using drag and drop, by utilizing jQuery UI. The problem is, that the container is overflow:auto; but it needs to be overflow:visible;, but if I do that, jQuery UI malfunctions. When a box drag is initiated, it will immediatly jump up aproximately 400-500px. This is how the draggable is created: $(".draggable").draggable({ revert: 'invalid', // when not dropped, the item will revert back to its initial position containment: '#editContainer', // stick to demo-frame if present helper: 'original', cursor: 'move' }); Is this a bug with jQuery UI, or can this be fixed on my end? I apologize for the lack of source code.

    Read the article

  • using focus function with jquery live

    - by Pradyut Bhattacharya
    I have a page in which i can successfully use the jquery focus function using live... $(".comment_text_class").live('focus', function() { //do something... }); but when something comes into the page(ajax loading) the focus function doesn't work as should be using the live function... as suggested i used focusin function.. $(".comment_text_class").live('focusin', function() { //do something... }); but still new elements do not have the behavior... also i want to hide something using the live function but it doesn't work at all.. even for the elements in the page itself... $(".comment_button").live('hide', function(){}); is the focus and hide function implemented at all by jquery 1.4.2 or is it a bug... because the live focus was not working with jquery 1.4 version... Please help... thanks Pradyut India

    Read the article

  • Where to put the default destroy in the jQuery UI 1.8.1 widget's destroy function

    - by dominicminicoopers
    Ok, I'm having a slight bit of confusion writing my own jQuery UI widget plugins. The problem lies in the destroy function. In the docs, it says to put the default destroy first then write other things particular to the widget after it. $.Widget.prototype.destroy.apply(this, arguments); // default destroy // now do other stuff particular to this widget See http://jqueryui.com/docs/Developer_Guide However in their example scripts (those being the actual pluings for jQuery Ui released code, does it the opposite. The $.Widget.prototype.destroy.apply(this, arguments); is at the end of the function. See http://dev.jqueryui.com/browser/trunk/ui/jquery.ui.progressbar.js (and all of the other built in widgets as well) So which is it? The way the current widgets are written, or by the explanation in the code comment in the Developer_Guide?

    Read the article

  • using JQuery and Prototype in the same page

    - by Don
    Hi, Several of my pages use both JQuery and Protoype. Since I upgraded to version 1.3 of JQuery this appears to be causing problems, because both libraries define a function named '$'. JQuery provides a function noConflict() which relinquishes control of $ to other libraries that may be using it. So it seems like I need to go through all my pages that look like this: <head> <script type="text/javascript" src="/obp/js/prototype.js"></script> <script type="text/javascript" src="/obp/js/jquery.js"></script> </head> and change them to look like this: <head> <script type="text/javascript" src="/obp/js/prototype.js"></script> <script type="text/javascript" src="/obp/js/jquery.js"></script> <script type="text/javascript"> jQuery.noConflict(); var $j = jQuery; </script> </head> I should then be able to use '$' for Prototype and '$j' (or 'jQuery') for JQuery. I'm not entirely happy about duplicating these 2 lines of code in every relevant page, and expect that at some point somebody is likely to forget to add them to a new page. I'd prefer to be able to do the following Create a file jquery-noconflict.js which "includes" jquery.js and the 2 lines of code shown above Import jquery-noconflict.js (instead of jquery.js) in all my JSP/HTML pages However, I'm not sure if it's possible to include one JS file in another, in the manner I've described? Of course an alternate solution is simply to add the 2 lines of code above to jquery.js directly, but if I do that I'll need to remember to do it every time I upgrade JQuery. Thanks in advance, Don

    Read the article

  • jQuery AJAX not redirecting?

    - by MidnightLightning
    I have a simple PHP page (for testing) that simply calls header("Location: http://www.example.com");exit;, which resides on the same server, in the same directory as another file with the following jQuery Javascript: $(document).ready(function() { jQuery.ajax({ type : 'GET', url : 'bounce.php', error : function(xhr, status, error) { console.log("ERROR: ", xhr, xhr.status, xhr.getAllResponseHeaders()); }, complete : function(xhr, status) { // Get headers of the response console.log("COMPLETE: ", xhr, xhr.status, xhr.getAllResponseHeaders()); } }); }); I was expecting (from several other StackOverflow responses) for the xhr.status to return "302", but instead the AJAX call is triggering the "error" event (and then the "complete" event), and xhr.status is returning 0 (zero), and .getAllResponseHeaders() is coming back null (in both the error, and complete functions). Firebug is showing the "302 Moved Temporarily", and the response headers. So why is this triggering the error event, and not passing along the proper 302 code, and headers? Is this something to do with the Same Origin since the bouncing script and the fetching script are both on the same server? Is this jQuery or Javascript's fault?

    Read the article

  • Real-time data on webpage with jQuery

    - by Steven Hepting
    I would like a webpage that constantly updates a graph with new data as it arrives. Regularly, all the data you have is passed to the page at the beginning of the request. However, I need the page to be able to update itself with fresh information every few seconds to redraw the graph. Background The webpage will be similar to this http://www.panic.com/blog/2010/03/the-panic-status-board/. The data coming in will temperature values to be graphed measured by an Arduino and saved to the Django database (this part is already complete). Update It sounds as though the solution is to use the jQuery.ajax() function ( http://api.jquery.com/jQuery.ajax/) with a function as the .complete callback that will schedule another request several seconds later to a URL that will return the data in JSON format. How can that method be scheduled? With the .delay() function?

    Read the article

  • JQUERY-UI Draggables - Seralize is running before the Draggable is complete

    - by nobosh
    Hello, I'm using the JQUERY-UI draggable plugin. As a setting, when the Draggable is done, using the STOP setting I run a function to seralize a list of LIs to get their order in terms of their IDs. For example, if I have an UL, with a list of LIs with the following IDs: 1,2,3,4,5 If I then move 5, between 2&3, the seralize is returning: 1,2,5,3,4,5 Which makes me think that the JQUERY UI-Draggable STOP is running before the page is finished rendering, or the DOM isn't update? Any ideas on how I can fix this from happening. Is there something I can do in my Seralize funtion to say, wait till JQUERY animations are all done, or stop all that are going on to ensure the DOM is accurate? Thanks

    Read the article

  • jQuery plugin options: required, optional, inaccessible

    - by Trevor Hartman
    I'm curious how to specify options to a jQuery plugin in a way that some are required, some are optionally overridden, and some can't be touched. I started off with the usual: jQuery.fn.plugin = function (options){ var defaults = { username: "", posts:10, api: "http://myapi.com" } var settings = jQuery.extend({}, defaults, options); } Let's say I want username to be required, posts is optional (defaults to 10) and you (you being the user of the plugin) can't change api, even if they try. Ideally, they'd all still be in the same data structure instead of being split into separate objects. Ideas?

    Read the article

  • jQuery - Add click event to Div and go to first link found

    - by LuckyShot
    Hi guys, I think I've been too much time looking at this function and just got stuck trying to figure out the nice clean way to do it. It's a jQuery function that adds a click event to any div with a click CSS class found in the page and when clicked it redirects the user to the first link found in the div. function clickabledivs() { $('.click').each( function (intIndex) { $(this).bind("click", function(){ window.location = $( "#"+$(this).attr('id')+" a:first-child" ).attr('href'); }); } ); } The code simply works although I'm pretty sure there is a fairly better way to accomplish it, specially the selector I am using: $( "#"+$(this).attr('id')+" a:first-child" ) looks too long and slow. Any ideas? Please let me know if you need more details. Thanks! PS: I've got some jQuery benchmarking reference from Project2k.de here: http://blog.projekt2k.de/2010/01/benchmarking-jquery-1-4/

    Read the article

  • edge case for selecting a checked radio input with jquery

    - by altvali
    Hi all! I have a problem selecting a checked radio button with jquery. The radio buttons are generated by a function from a MVC that i'd rather not change and its name is like id[number]. Simply put, I have to check if any of these buttons are checked: <input type="radio" name="id[1]" value="1"/ <input type="radio" name="id[1]" value="2"/ The problem is that jQuery('input:radio[name=id[1]]:checked').val() will select some function from the jQuery library. Any help will be much appreciated.

    Read the article

< Previous Page | 25 26 27 28 29 30 31 32 33 34 35 36  | Next Page >