Search Results

Search found 18690 results on 748 pages for 'jquery cookie'.

Page 23/748 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • jQuery Validation plugin: checkbox groups and error message issues

    - by boomturn
    I've put together a form using the jQuery Validation plugin, and all inputs are fine with working validation and error messages – except for checkboxes. I have two checkbox problems. The first is that the Validation plugin API doesn't seem to handle checkboxes in grouped contexts (I'm using fieldsets for grouping). Found several approaches to the issue here, including reference to a post by Rebecca Murphey for a more general case using a custom method and class. Adapting that to this situation: jQuery.validator.addMethod('required_group', function(val, el) { var fieldParent = $(el).closest('fieldset'); return fieldParent.find('.required_group:checked').length; }); jQuery.validator.addClassRules('required_group', { 'required_group': true }); jQuery.validator.messages.required_group = 'Please check at least one box.'; This sort of works, but produces error messages on every checkbox, and only removes them as each box is clicked. This is not an acceptable situation for the user, who can only get rid of them by clicking false positives. Ideally, I guess what's needed is something to prevent or eliminate extra messages before they are displayed and use errorPlacement to display a single error message in the parent fieldset, that would then be removed with a click on any checkbox. Less ideally, maybe they would all display but an event handler could turn off the full set of redundant messages with a click, which is what this approach offered by tvanfosson appears to do. (Another customized approach here, but I couldn't get it to work.) I guess I should also note this form requires the checkboxes to have different names. My second problem is that one of the fieldsets with checkboxes in the form also contains a nested fieldset of checkboxes under one of the outer checkboxes. So in addition to the first-level one-box-checked requirement, if the particular checkbox containing the second-level checkboxes is checked, then at least one of the second-level boxes must be checked. Not sure about the right approach; I'm guessing what needs to happen (following the above scheme) is that the trigger checkbox would use toggleClass to add/remove 'required_group' class to all the checkboxes in the subfield, which would then (hopefully) behave the same as the parent field: $("#triggerCheckbox").click(function () { $(this).find(":checkbox").toggleClass("required_group"); }); Any suggestions or ideas welcome. I'm well beyond my limited jQuery skills on this one and would be happy to hear that I missed simple, elegant and/or obvious ways to do this!

    Read the article

  • jQuery TypeError: example("input#autocomplete").autocomplete is not a function

    - by Ankush Kalia
    I have tried alot to remove this error but could not get success.When i am running this script on localhost its working fine but not working on Joomla frame work. The code is below: <!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> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <?php $viewFields=array('c++', 'java', 'php', 'coldfusion', 'javascript', 'asp', 'ruby'); ?> <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script> <script> var example=jQuery.noConflict(); var arrayFromPHP = <?php echo json_encode($viewFields) ?>; example(document).ready(function() { example("input#autocomplete").autocomplete({ source: arrayFromPHP }); }); </script> </head> <body> <center> <p><img src="<?php echo JURI::base(); ?>images/search_1.png" border="0" alt="" /> <img src="<?php echo JURI::base(); ?>images/business_2.png" border="0" alt="" /> <img src="<?php echo JURI::base(); ?>images/review_3.png" border="0" alt="" /> </p> </center> <input id="autocomplete" /> </body> </html> Its giving me this error:- -- [08:30:24.870] Use of getAttributeNode() is deprecated. Use getAttribute() instead. @ http://50.116.97.120/~amarhost/storage/media/system/js/mootools-core.js:343 [08:30:27.853] TypeError: example("input#autocomplete").autocomplete is not a function @ http://50.116.97.120/~amarhost/storage/index.php/component/storage/?action=war&Itemid=105:210

    Read the article

  • Goodby jQuery Templates, Hello JsRender

    - by SGWellens
    A funny thing happened on my way to the jQuery website, I blinked and a feature was dropped: jQuery Templates have been discontinued. The new pretender to the throne is JsRender. jQuery Templates looked pretty useful when they first came out. Several articles were written about them but I stayed away because being on the bleeding edge of technology is not a productive place to be. I wanted to wait until it stabilized…in retrospect, it was a serendipitous decision. This time however, I threw all caution to the wind and took a close look at JSRender. Why? Maybe I'm having a midlife crisis; I'll go motorcycle shopping tomorrow. Caveat, here is a message from the site: Warning: JsRender is not yet Beta, and there may be frequent changes to APIs and features in the coming period. Fair enough, we've been warned. The first thing we need is some data to render. Below is some JSON formatted data. Typically this will come from an asynchronous call to a web service. For simplicity, I hard coded a variable:     var Golfers = [         { ID: "1", "Name": "Bobby Jones", "Birthday": "1902-03-17" },         { ID: "2", "Name": "Sam Snead", "Birthday": "1912-05-27" },         { ID: "3", "Name": "Tiger Woods", "Birthday": "1975-12-30" }         ]; We also need some templates, I created two. Note: The script blocks have the id property set. They are needed so JsRender can locate them.     <script id="GolferTemplate1" type="text/html">         {{=ID}}: <b>{{=Name}}</b> <i>{{=Birthday}}</i> <br />     </script>       <script id="GolferTemplate2" type="text/html">         <tr>             <td>{{=ID}}</td>             <td><b>{{=Name}}</b></td>             <td><i>{{=Birthday}}</i> </td>         </tr>     </script> Including the correct JavaScript files is trivial:     <script src="Scripts/jquery-1.7.js" type="text/javascript"></script>     <script src="Scripts/jsrender.js" type="text/javascript"></script> Of course we need some place to render the output:     <div id="GolferDiv"></div><br />     <table id="GolferTable"></table> The code is also trivial:     function Test()     {         $("#GolferDiv").html($("#GolferTemplate1").render(Golfers));         $("#GolferTable").html($("#GolferTemplate2").render(Golfers));           // you can inspect the rendered html if there are poblems.         // var html = $("#GolferTemplate2").render(Golfers);     } And here's what it looks like with some random CSS formatting that I had laying around.    Not bad, I hope JsRender lasts longer than jQuery Templates. One final warning, a lot of jQuery code is ugly, butt-ugly. If you do look inside the jQuery files, you may want to cover your keyboard with some plastic in case you get vertigo and blow chunks. I hope someone finds this useful. Steve Wellens CodeProject

    Read the article

  • Google App Engine - Secure Cookies

    - by tponthieux
    I'd been searching for a way to do cookie based authentication/sessions in Google App Engine because I don't like the idea of memcache based sessions, and I also don't like the idea of forcing users to create google accounts just to use a website. I stumbled across someone's posting that mentioned some signed cookie functions from the Tornado framework and it looks like what I need. What I have in mind is storing a user's id in a tamper proof cookie, and maybe using a decorator for the request handlers to test the authentication status of the user, and as a side benefit the user id will be available to the request handler for datastore work and such. The concept would be similar to forms authentication in ASP.NET. This code comes from the web.py module of the Tornado framework. According to the docstrings, it "Signs and timestamps a cookie so it cannot be forged" and "Returns the given signed cookie if it validates, or None." I've tried to use it in an App Engine Project, but I don't understand the nuances of trying to get these methods to work in the context of the request handler. Can someone show me the right way to do this without losing the functionality that the FriendFeed developers put into it? The set_secure_cookie, and get_secure_cookie portions are the most important, but it would be nice to be able to use the other methods as well. #!/usr/bin/env python import Cookie import base64 import time import hashlib import hmac import datetime import re import calendar import email.utils import logging def _utf8(s): if isinstance(s, unicode): return s.encode("utf-8") assert isinstance(s, str) return s def _unicode(s): if isinstance(s, str): try: return s.decode("utf-8") except UnicodeDecodeError: raise HTTPError(400, "Non-utf8 argument") assert isinstance(s, unicode) return s def _time_independent_equals(a, b): if len(a) != len(b): return False result = 0 for x, y in zip(a, b): result |= ord(x) ^ ord(y) return result == 0 def cookies(self): """A dictionary of Cookie.Morsel objects.""" if not hasattr(self,"_cookies"): self._cookies = Cookie.BaseCookie() if "Cookie" in self.request.headers: try: self._cookies.load(self.request.headers["Cookie"]) except: self.clear_all_cookies() return self._cookies def _cookie_signature(self,*parts): self.require_setting("cookie_secret","secure cookies") hash = hmac.new(self.application.settings["cookie_secret"], digestmod=hashlib.sha1) for part in parts:hash.update(part) return hash.hexdigest() def get_cookie(self,name,default=None): """Gets the value of the cookie with the given name,else default.""" if name in self.cookies: return self.cookies[name].value return default def set_cookie(self,name,value,domain=None,expires=None,path="/", expires_days=None): """Sets the given cookie name/value with the given options.""" name = _utf8(name) value = _utf8(value) if re.search(r"[\x00-\x20]",name + value): # Don't let us accidentally inject bad stuff raise ValueError("Invalid cookie %r:%r" % (name,value)) if not hasattr(self,"_new_cookies"): self._new_cookies = [] new_cookie = Cookie.BaseCookie() self._new_cookies.append(new_cookie) new_cookie[name] = value if domain: new_cookie[name]["domain"] = domain if expires_days is not None and not expires: expires = datetime.datetime.utcnow() + datetime.timedelta( days=expires_days) if expires: timestamp = calendar.timegm(expires.utctimetuple()) new_cookie[name]["expires"] = email.utils.formatdate( timestamp,localtime=False,usegmt=True) if path: new_cookie[name]["path"] = path def clear_cookie(self,name,path="/",domain=None): """Deletes the cookie with the given name.""" expires = datetime.datetime.utcnow() - datetime.timedelta(days=365) self.set_cookie(name,value="",path=path,expires=expires, domain=domain) def clear_all_cookies(self): """Deletes all the cookies the user sent with this request.""" for name in self.cookies.iterkeys(): self.clear_cookie(name) def set_secure_cookie(self,name,value,expires_days=30,**kwargs): """Signs and timestamps a cookie so it cannot be forged""" timestamp = str(int(time.time())) value = base64.b64encode(value) signature = self._cookie_signature(name,value,timestamp) value = "|".join([value,timestamp,signature]) self.set_cookie(name,value,expires_days=expires_days,**kwargs) def get_secure_cookie(self,name,include_name=True,value=None): """Returns the given signed cookie if it validates,or None""" if value is None:value = self.get_cookie(name) if not value:return None parts = value.split("|") if len(parts) != 3:return None if include_name: signature = self._cookie_signature(name,parts[0],parts[1]) else: signature = self._cookie_signature(parts[0],parts[1]) if not _time_independent_equals(parts[2],signature): logging.warning("Invalid cookie signature %r",value) return None timestamp = int(parts[1]) if timestamp < time.time() - 31 * 86400: logging.warning("Expired cookie %r",value) return None try: return base64.b64decode(parts[0]) except: return None uid=1234|1234567890|d32b9e9c67274fa062e2599fd659cc14 Parts: 1. uid is the name of the key 2. 1234 is your value in clear 3. 1234567890 is the timestamp 4. d32b9e9c67274fa062e2599fd659cc14 is the signature made from the value and the timestamp

    Read the article

  • jQuery validation: how to customize trigger and response

    - by user302307
    I am new with jQuery. I have a servlet based application which render an HTML form. This form is submitted via a function and the submit button IS NOT submit button in HTML. It's a regular button that calls a javascript function to do the submission. When running the submission function, the servlet also run a function called doCheck() which is in javascript. This doCheck() function can be defined per page basis. if doCheck returns false, then the servlet will stop the submission; else it will submit the form. I want to use jQuery validation to fit the servlet application. Is there a way to customize jQuery validation to be triggered manually (ie. only when doCheck() is executed) but at the same time provides continuous check on the UI (ie. if one type invalid number in date field, it will gives the appropriate msg when onblur event happen)? Is there a way to make jQuery validation return true or false? Thank you.

    Read the article

  • Using jQuery, setting Draggable on an element prevents blur from firing when you click the draggable

    - by Danno
    Using jQuery, when you set a blur event on a text box and set another element as draggable, when you click the draggable element, the blur event does not fire in FireFox. IE is a little better, you get the blur event but you don't get the click event on the draggable element. If you don't specify the cancel: "" in the draggable constructor, you will get the blur event to fire, but then the element you want to drag is not draggable. jQuery v1.3.2 jQuery UI v1.7.2 The console.log lines are for FireFox's FireBug plugin. <HTML> <HEAD> <TITLE>Blur/Click Workbench</TITLE> <script src="js/jquery.js" type="text/javascript" ></script> <script src="js/ui/ui.core.js" type="text/javascript"></script> <script src="js/ui/ui.draggable.js" type="text/javascript"></script> <script type="text/javascript"> function blurring() { console.log('1 - blurring - ' + $( this ).attr('id')); } function clicking() { console.log('2 - clicking - ' + $( this ).attr('id')); } $(document).ready(function() { $( ".draggableTool" ).draggable( { cancel: "" } ); $( '.property' ).blur( blurring ); $( '#labelContainer' ).click( clicking ); }); </script> </HEAD> <BODY> <input type='text' class='property' id='tb1' /> <br /> <input type='text' class='property' id='tb2' /> <br /> <label class='draggableTool' id='labelContainer' style='height:20px;position:absolute;'> <textarea id='taLabel' style='height:100%;background-color:white;border:1px solid grey;'>Label</textarea> </label> </BODY> </HTML>

    Read the article

  • prompt error in jquery ui file

    - by phil
    I run the script in IE 8 and get error message after typing in the input field: //error message from IE8 Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; InfoPath.2) Timestamp: Mon, 7 Jun 2010 23:13:10 UTC Message: Object expected Line: 570 Char: 394 Code: 0 URI: http://localhost/zhong/jquery-ui-1.8.2.custom.min.js <script src="jquery-1.4.2.min.js"></script> <script src="jquery-ui-1.8.2.custom.min.js"></script> <link rel="stylesheet" type="text/css" href="jquery-ui-1.8.2.custom.css" /> <body> Search: <input id="example" /> </body> <script> $(document).ready(function(){ var data = "Core Selectors Attributes Traversing Manipulation CSS Events Effects Ajax Utilities".split(" "); $("#example").autocomplete(data); }); </script>

    Read the article

  • PHP HttpRequest Cookie Issue

    - by Daaron
    I have a chunk of code to login to test a web site login: $r = new HttpRequest($newlocation, HttpRequest::METH_GET); $r-addCookies($cookieArray); $r-send(); The content of $cookieArray is from a redirect, but I don't modify it in any way. The really baked part is that if the value of the cookie (an authentication token string) contains a slash, it doesn't login properly. If it doesn't have a slash, everything works. Any ideas are appreciated.

    Read the article

  • 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

  • jquery-ui autocomplete with ASP MVC suggestions not displaying

    - by adamnickerson
    I have been trying to get a simple example of the jquery-ui autocomplete to work. I have a controller setup to handle the query, and it returns the json that looks to be in order, but I am getting no suggestions showing up. Here are the js libraries I am including: <script type="text/javascript" language="javascript" src="/Scripts/jquery-1.4.1.js"></script> <script type="text/javascript" language="javascript" src="/Scripts/jquery-ui-1.8.1.custom.min.js"></script> <link href="/Content/jquery-ui-1.8.1.custom.css" rel="stylesheet" type="text/css" /> and here is the javascript and the form tags: <script type="text/javascript"> $(function () { $("#organization").autocomplete({ source: function (request, response) { $.ajax({ url: '/Organization/OrganizationLookup', dataType: "json", data: { limit: 12, q: request.term } }) }, minLength: 2 }); }); </script> <div class="ui-widget"> <label for="organization">Organization: </label> <input id="organization" /> </div> I get back a json response that looks reasonable from my controller: [{"id":"Sector A","value":"Sector A"},{"id":"Sector B","value":"Sector B"},{"id":"Sector C","value":"Sector C"}] id and value seem to be the default naming that autocomplete is looking for. But I get no joy at all. Any thoughts?

    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

  • 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

  • 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 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

  • 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

  • problem jquery.ui.autocomplete 1.8 with height and overflow with IE

    - by fabrice
    Hello, I have a probleme with jquery.ui.autocomplete 1.8 rc2 in IE7 or IE8 with the following CSS (inside jquery.ui.autocomplete.css) : .ui-menu { list-style:none; padding: 2px; margin: 0;display:block; height:200px; overflow:scroll; } I'm using the demo from the project called : demos\autocomplete\remote-jsonp.html It's working perfect with firefox but with IE7 or 8, each time I click on the scroll bar to see the end of the list, it selects an element instead of scrolling down. Do you please have a solution to have a fixed height with jquery.ui.autocomplete and a scroll bar working with IE ? Thank you very much

    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

  • Cant get Jquery ui autocomplete widget to work

    - by Boob
    Im trying to develop my first ASP.NET MVC web app and have run into a problem with the jquery ui autocomplete widget. At the moment I have a form with a number of text boxs which would lend themselves well to an autocomplete ability. The code for my "Make"(Car make) text box is show below: jquery: $(function() { $("#Make").autocomplete({ source: '<%=Url.Action("Make","AutoComplete") %>' }); }); ASP.NET MVC controller: public ActionResult Make(string term) { return Json(Service.GetHints(HintType.Make, term, 20)); } GetHints() returns an IList of Hints, an object with just label and value string properties. The documentation implies that this is what I should be returning to the jquery but it doesnt want to work? Can anyone give me any advice/help?

    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

  • 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

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >