Search Results

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

Page 90/953 | < Previous Page | 86 87 88 89 90 91 92 93 94 95 96 97  | Next Page >

  • jQuery AJAX request (Rails 3) gets redirected and returns empty message body (only with SSL)!

    - by elsurudo
    I'm trying to do a manual jQuery AJAX request the following way: $("#user_plan_id").change(function() { $("#plan_container").load('/plans/' + this.value); }); I have the "rails.js" file included in my header, and a "<%= csrf_meta_tag %". I see from my log that the request IS getting to the server (although without the authenticity token... does rails.js even do this?), but the response is a 302 (Found) rather than 200, and no data actually gets rendered. Any ideas? Edit: I now see that the first request redirects, and the proper partial gets rendered on the redirect. However, the 2nd response's body (on the client-side) is still empty. I'm guessing jQuery uses the first response and doesn't have a listener set up for the redirect. How do I get around this? Also, another note: the page doing the requesting is an HTTPS page. Here is what my log says: Started GET "/plans/221168073" for 127.0.0.1 at Tue Jun 15 01:24:06 -0400 2010 Processing by PlansController#show as HTML Parameters: {"id"=>"221168073"} DEPRECATION WARNING: Using #request_uri is deprecated. Use fullpath instead. (called from ensure_proper_protocol at /Users/ernestsurudo/Sites/vidfolia/vendor/plugins/ssl_requirement/lib/ssl_requirement.rb:57) Redirected to http://vidfolia.com/plans/221168073 Completed 302 Found in 1ms It turns out that if I turn off SSL requirement for that page, it works! I still have no idea why, though. So I suppose my question is: what is the workaround?

    Read the article

  • How should I write Jquery Mobile app for browsers with and without javascript support?

    - by Adrian Grigore
    Hi, I'm trying to wrap my head around jQuery Mobile. My aim is to build a very fast application with a look and feel as close as possible to a native app (at least for modern devices). I understand there are two ways of navigating between pages: Loading each page as a separate page and linking to other pages with regular html anchors. Putting all (or many) pages on one single web page and navigating between them by means of javascript ($.mobile.changePage (method) and similar api functions. The first approach should work on all browsers, but performs quite poorly since there is a delay between each page transition. The second looks like it should be much faster, so I would definitely prefer this approach. But how would that work for mobile device browsers without javascript support? It certainly seems to violate jQuery Mobile's aim to provide a gracefully degraded experience for C-grade browsers. It looks to me like I need to implement my app twice, once optimized for browsers with javascript support, once for browsers without? Using may be another option, but that looks even more messy. What's the recommended way to approach this dilemma? Is there anything I have not noticed? Thanks, Adrian

    Read the article

  • Can I copy/clone a function in JavaScript?

    - by Craig Stuntz
    I'm using jQuery with the validators plugin. I would like to replace the "required" validator with one of my own. This is easy: jQuery.validator.addMethod("required", function(value, element, param) { return myRequired(value, element, param); }, jQuery.validator.messages.required); So far, so good. This works just fine. But what I really want to do is call my function in some cases, and the default validator for the rest. Unfortunately, this turns out to be recursive: jQuery.validator.addMethod("required", function(value, element, param) { // handle comboboxes with empty guids if (someTest(element)) { return myRequired(value, element, param); } return jQuery.validator.methods.required(value, element, param); }, jQuery.validator.messages.required); I looked at the source code for the validators, and the default implementation of "required" is defined as an anonymous method at jQuery.validator.messages.required. So there is no other (non-anonymous) reference to the function that I can use. Storing a reference to the function externally before calling addMethod and calling the default validator via that reference makes no difference. What I really need to do is to be able to copy the default required validator function by value instead of by reference. But after quite a bit of searching, I can't figure out how to do that. Is it possible? If it's impossible, then I can copy the source for the original function. But that creates a maintenance problem, and I would rather not do that unless there is no "better way."

    Read the article

  • JQuery idleTimeout plugin: How to display the dialog after the session is timedout on ASP.NET MVC Pa

    - by Rita
    Hi I am working on migrating the ASP.NET apllication to MVC Framework. I have implemented session timeout for InActiveUser using JQuery idleTimeout plugin. I have set idletime for 30 min as below in my Master Page. So that After the user session is timedout of 30 Min, an Auto Logout dialog shows for couple of seconds and says that "You are about to be signed out due to Inactivity" Now after this once the user is logged out and redirected to Home Page. Here i again want to show a Dialog and should stay there saying "You are Logged out" until the user clicks on it. Here is my code in Master page: $(document).ready(function() { var SEC = 1000; var MIN = 60 * SEC; // http://philpalmieri.com/2009/09/jquery-session-auto-timeout-with-prompt/ <% if(HttpContext.Current.User.Identity.IsAuthenticated) {%> $(document).idleTimeout({ inactivity: 30 * MIN, noconfirm : 30 * SEC, redirect_url: '/Account/Logout', sessionAlive: 0, // 30000, //10 Minutes click_reset: true, alive_url: '', logout_url: '' }); <%} %> } Logout() Method in Account Controller: public virtual ActionResult Logout() { FormsAuthentication.SignOut(); return RedirectToAction(MVC.Home.Default()); } Appreciate your responses.

    Read the article

  • jQuery AJAX request (Rails 3) gets redirected and returns empty message body!

    - by elsurudo
    I'm trying to do a manual jQuery AJAX request the following way: $("#user_plan_id").change(function() { $("#plan_container").load('/plans/' + this.value); }); I have the "rails.js" file included in my header, and a "<%= csrf_meta_tag %". I see from my log that the request IS getting to the server (although without the authenticity token... does rails.js even do this?), but the response is a 302 (Found) rather than 200, and no data actually gets rendered. Any ideas? Edit: I now see that the first request redirects, and the proper partial gets rendered on the redirect. However, the 2nd response's body (on the client-side) is still empty. I'm guessing jQuery uses the first response and doesn't have a listener set up for the redirect. How do I get around this? Also, another note: the page doing the requesting is an HTTPS page. Here is what my log says: Started GET "/plans/221168073" for 127.0.0.1 at Tue Jun 15 01:24:06 -0400 2010 Processing by PlansController#show as HTML Parameters: {"id"=>"221168073"} DEPRECATION WARNING: Using #request_uri is deprecated. Use fullpath instead. (called from ensure_proper_protocol at /Users/ernestsurudo/Sites/vidfolia/vendor/plugins/ssl_requirement/lib/ssl_requirement.rb:57) Redirected to http://vidfolia.com/plans/221168073 Completed 302 Found in 1ms Perhaps it has something to do with the deprecation warning?

    Read the article

  • jQuery: how to create a new div, assign some attributes, and create an id from some other elements a

    - by Ronedog
    jQuery: how to create a new div, assign some attributes, and create an id from some other elements attributes? How can I accomplish this. What I've tried below is not working and I'm unsure how to make it work. What I'm trying to do is create a div and assign it some attributes, then append this div to all the < li elements that are the on the last node of my unordered list. And lastly, but most important I want to retrieve the value of the attribute called "p_node" from the < li that is being appended to and insert it in as part of the ID of the newly created div. Here's my current jQuery code: $('<div />,{id:"'+ $("#nav li:not(:has(li))").attr("p_node").val() +'_p_cont_div", class:"property_position"}').appendTo("#nav li:not(:has(li))"); Here's the HTML before the div creation: <ul> <li p_node="98" class="page_name">Category A</li> </ul> <ul> <li p_node="99" class="page_name">Category B</li> </ul> Here's what I want it to look like after the new div creation: <ul> <li p_node="98" class="page_name">Category A</li> <div id="98_p_cont_div" class="property_position"></div> </ul> <ul> <li p_node="99" class="page_name">Category B</li> <div id="99_p_cont_div" class="property_position"></div> </ul>

    Read the article

  • How to have multiple instances of jQuery plugin on single page?

    - by James Skidmore
    I'm writing a simple jQuery plugin, but I'm having trouble being able to use multiple instances on a page. For instance, here is a sample plugin to illustrate my point: (function($) { $.fn.samplePlugin = function(options) { if (typeof foo != 'undefined') { alert('Already defined!'); } else { var foo = 'bar'; } }; })(jQuery); And then if I do this: $(document).ready(function(){ $('#myDiv').samplePlugin({}); // does nothing $('#myDiv2').samplePlugion({}); // alerts "Already defined!" }); This is obviously an over-simplified example to get across the point. So my question is, how do I have two separate instances of the plugin? I'd like to be able to use it across multiple instances on the same page. I'm guessing that part of the problem might be with defining the variables in a global scope. How can I define them unique to that instance of the plugin then? Thank you for your guidance!

    Read the article

  • Why is my jQuery event not being triggered when the button is clicked?

    - by Ankur
    I am trying to call the .ajax() method when a button with id=go is clicked. This button is displayed when another jQuery event is triggered, namely that a button with a class called predicate is clicked. The button with id=go is displayed without any problems but on clicking it, there is no call to the alert() or getResults() method which are supposed to occur. Howver if I hard code the button with id=go into the page and don't have it generated by jQuery then the thing works fine. Why does the generated code cause a problem. $(document).ready( function() { $(".predicate").click( function() { makeQuery(this.id); //alert(this.id); }); $(".object").click( function() { //alert(this.id); }); var variables = 0; var queryString = ""; var noOfResults; var formValues=""; var goBegin = ""; var goEnd = "<br/><input name='go' id='go' type='button' value='go'/>"; function makeQuery(value) { queryString = queryString + "val" + variables + "=" + value + "&"; formValues=formValues+"<input type='hidden' name='val"+variables+"' value='"+value+"' />"; variables = variables + 1; $("#resultCount").html(goBegin+formValues+queryString+goEnd); } function getResults(){ $.ajax( { type : "GET", url : "ObjectCount", data : queryString + "count=" + variables, success : function(results) { noOfResults = results; $("#resultCount").html(results - 1 + " results"); } }); } $("#go").click( function() { alert("We have been alerted"); getResults(); }); });

    Read the article

  • How to refresh jQuery Selector Value after an execution?

    - by Devyn
    Hi, I have like this. $(document).ready(function() { var $clickable_pieces = $('.chess_piece').parent(); $($clickable_pieces).addClass('selectee'); // add selectee class var $selectee = $('.chess_square.selectee'); // wait for click $($selectee).bind('click',function(){ $('.chess_square.selected').removeClass('selected'); $(this).addClass('selected'); { ........... } }); I initially inject 'selectee' class to all div which has 'chess_piece' class then I select DIVs with that class $('.chess_square.selectee'). <div id="clickable"> <div id="div1" class="chess_square"> </div> <div id="div2" class="chess_square selectee"> <div id="sub1" class="chess_piece queen"></div> </div> <div id="div3" class="chess_square"> </div> </div> There are two type of DIV element with class named 'chess_square selectee' and 'chess_square' which doesn't meant to be clickable. I move around Sub DIV of 'rps_square selectee' from DIV2 to DIV1 and add and remove classes to be exactly same like this. The meaning is Queen Piece is moved from Div2 to Div1. <div id="div1" class="chess_square selectee"> <div id="sub1" class="chess_piece queen"></div> </div> <div id="div2" class="chess_square"> </div> <div id="div3" class="chess_square"> </div> However, the problem is jQuery doesn't update var $selectee = $('.rps_square.selectee');. Even though I changed class names, DIV1 is not clickable and DIV2 is still clickable. By the way, I've used jQuery UI selectable but doesn't refresh either.

    Read the article

  • Rewriting jQuery to plain old javascript - are the performance gains worth it?

    - by Swader
    Since jQuery is an incredibly easy and banal library, I've developed a rather complex project fairly quickly with it. The entire interface is jQuery based, and memory is cleaned regularly to maintain optimum performance. Everything works very well in Firefox, and exceptionally so in Chrome (other browsers are of no concern for me as this is not a commercial or publicly available product). What I'm wondering now is - since pure plain old javascript is really not a complicated language to master, would it be performance enhancing to rewrite the whole thing in plain old JS, and if so, how much of a boost would you expect to get from it? If the answers prove positive enough, I'll go ahead and do it, run a benchmark and report back with the precise findings. Cheers Edit: Thanks guys, valuable insight. The purpose was not to "re-invent the wheel" - it was just for experience and personal improvement. Just because something exists, doesn't mean you shouldn't explore it into greater detail, know how it works or try to recreate it. This is the same reason I seldom use frameworks, I would much rather use my own code and iron it out and gain massive experience doing it, than start off by using someone else's code, regardless of how ironed out it is. Anyway, won't be doing it, thanks for saving me the effort :)

    Read the article

  • Jquery Dialog - Is there a way to open it without registering it using .dialog?

    - by Raja
    This is my problem. I have a page with multiple tabs. I load those tabs dynamically and one of those tabs is a message container (mail). Every time I click a folder link (Inbox, Sent Mail etc) I reload just that tab alone with appropriate content. I use Jquery dialog to pick contacts and I have to load contacts everytime. Since I reload the whole tab content every time JQuery Dialog registers (or creates) the whole div content. To avoid this I did this: if ($("#ui-dialog-title-divContacts").length == 0) { //if dialog data is not created then make dialog $("#divContacts").dialog({ bgiframe: true, resizable: false, autoOpen: false, height: 600, width: 425, modal: true, overlay: { backgroundColor: '#000', opacity: 0.5 }, buttons: { Cancel: function () { //basically do nothing $(this).dialog("close"); }, 'Done': function () { $("#divTo").empty().html($("#divSelectedContacts").html()); $(this).dialog("close"); } } }); } I went to generated viewsource in FF and found that only one instance is being created. My problem now is it is not showing the dialog. Is there a way by which I can open this dialog without registering it. Any help is much appreciated.

    Read the article

  • How to get jQuery to find the first list-item, rather than all list-items?

    - by ricebowl
    I'm trying to implement a basic jQuery infinite carousel. As much for the learning process as for anything else (as a rule I'm not a fan of re-inventing wheels, but...I have to learn somehow, might as well start with the basics). I've managed to get the list to animate left happily enough, but I'm stuck when it comes to selecting the first element of the list. I've tried to use: $('ul#services > li:first'); $('ul#services > li:first-child'); $('ul#services > li').eq([0]); (xhtml below), In each case a console.log(first) (the var name used) returns all of the list-items. Am I doing something blatantly, and obviously, wrong? The eventual plan is to clone the first li, append it to the parent ul, remove the li from the list and allow the list to scroll infinitely. It's just a list of services rather than links so I'm not -at the moment- planning to have scroll or left/right functionality. Current xhtml: <div class="wrapper"> <ul id="services"> <!-- closing the `</li>` tags on the following line is to remove whitespace in the horizontal list, doesn't seem to make a difference to the jQuery from my own testing. --> <li>one</li ><li>two</li ><li>three</li ><li>four</li ><li>five</li ><li>six</li ><li>seven</li ><li>eight</li ><li>nine</li ><li>ten</li> </ul> </div>

    Read the article

  • jQuery Mobile: How to run a callback-function before $.mobile.changePage?

    - by Jugi84
    I'm setting up a mobile app with jQuery Mobile and PhoneGap. What I want to do is that when I click link with id "news_link" I want jQuery to fetch data from database and put it to jQm's collapsible set. In my solution, I've wanted to use $.mobile.changePage inside callback functions because I want to wait until the data has been fetched and put inside the container before the code changes page. Here's the code: $(function() { $('#news_link').click(function(){ loadNewsFromDB(function(){ $.mobile.changePage( $("#news"), { transition: "slideup"} ); }); }); loadNewsFromDB is PhoneGap's SQLite database function which would fetch the data with more callback functions from database. The contents would be put to desired container with .html-function function loadNewsFromDB(){ //some code here theDB.transaction(function(tx) { tx.executeSql(sqlStr, [], onLoadNewsSuccess, onLoadNewsError); },onTxError, onTxSuccess); function onLoadNewsSuccess(tx, results){ //some code here $("#newsSet").html(htmlCodeAndContentToPut); Html is jQm's basic ui-modules: <!-- some html code here --!> <div data-role="page" id="news"> <div data-role="content"> <div id="newsSet" data-role="collapsible-set" data-mini="true"> With debugging I know that the code work up until it works very well unti it arrives to $.mobile.changePage-function. Somehow it doesn't change the page. I've checked the function it works well in other occasions, but not inside callback-functions. I would be very grateful if someone would give me a hand am I not seeing something obviously wrong or is something more specific? What other workarounds there is for fetching the data from SQLite, waiting for data to be fetched, putting the data to container and then changing the pages?

    Read the article

  • How to delete the first child of an element but referenced by $(this) in Jquery?

    - by Raja
    The scenario is I have two Divs one is where I select items (divResults) and it goes to the next div (divSelectedContacts). When I select it I place a tick mark next to it. What I want to do is when I select it again I want to remove the tick mark and also remove the element from divSelectedContacts. Here is the code. $("#divResults li").click(function() { if ($(this).find('span').size() == 1) { var copyElement = $(this).children().clone(); $(this).children().prepend("<span class='ui-icon ui-icon-check checked' style='float:left'></span>"); $("#divSelectedContacts").append(copyElement); } else { var deleteElement = $(this).find('span'); //here is the problem how to find the first span and delete it $(deleteElement).remove(); var copyElement = $(this).children().clone();//get the child element $("#divSelectedContacts").find(copyElement).remove(); //remove that element by finding it } }); I don't know how to select the first span in a li using $(this). Any help is much appreciated.

    Read the article

  • Does a jQuery selector by id always work without quotes and # sign?

    - by anarinsky
    I suddenly found that while using Mozilla / jQuery v1.8.2 I do not need to use the id with quotes and # sign. For example, $(bt2) works the same as $(“#bt2”), see the code below. Will this selector always work and are there any potential drawbacks from using this shorter form of selection? <html> <head> <title>append</title> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(document).ready (function(){ $(bt2).click(function(){ $(i1).append("<li>a4</li>", "<li>a5</li>"); }); }); </script> </head> <body> <button id="Button1">Append List</button> <ul id="i1"> <li>a1</li> </ul> </body> </html>

    Read the article

  • jQuery validation plugin: valid() does not work with remote validation ?

    - by a-dilla
    I got started by following this awesome tutorial, but wanted to do the validation on on keyup and place my errors somewhere else. The remote validation shows its own error message at the appropriate times, making me think I had it working. But if I ask specifically if a field with remote validation is valid, it says no, actually, its not. In application.js I have this... $("#new_user").validate({ rules: { "user[login]": {required: true, minlength: 3, remote: "/live_validations/check_login"}, }, messages: { "user[login]": {required: " ", minlength: " ", remote: " "}, } }); $("#user_login").keyup(function(){ if($(this).valid()){ $(this).siblings(".feedback").html("0"); }else{ $(this).siblings(".feedback").html("1"); } }) And then this in the rails app... def check_login @user = User.find_by_login(params[:user][:login]) respond_to do |format| format.json { render :json => @user ? "false" : "true" } end end I think that my problem might have everything to do with this ticket over at jQuery, and tried to implement that code, but, being new to jQuery, it's all a bit over my head. When I say bit, I mean way way. Any ideas to fix it, or a new way to look at it, would be a big help.

    Read the article

  • Kendo UI Mobile with Knockout for Master-Detail Views

    - by Steve Michelotti
    Lately I’ve been playing with Kendo UI Mobile to build iPhone apps. It’s similar to jQuery Mobile in that they are both HTML5/JavaScript based frameworks for buildings mobile apps. The primary thing that drew me to investigate Kendo UI was its innate ability to adaptively render a native looking app based on detecting the device it’s currently running on. In other words, it will render to look like a native iPhone app if it’s running on an iPhone and it will render to look like a native Droid app if it’s running on a Droid. This is in contrast to jQuery Mobile which looks the same on all devices and, therefore, it can never quite look native for whatever device it’s running on. My first impressions of Kendo UI were great. Using HTML5 data-* attributes to define “roles” for UI elements is easy, the rendering looked great, and the basic navigation was simple and intuitive. However, I ran into major confusion when trying to figure out how to “correctly” build master-detail views. Since I was already very family with KnockoutJS, I set out to use that framework in conjunction with Kendo UI Mobile to build the following simple scenario: I wanted to have a simple “Task Manager” application where my first screen just showed a list of tasks like this:   Then clicking on a specific task would navigate to a detail screen that would show all details of the specific task that was selected:   Basic navigation between views in Kendo UI is simple. The href of an <a> tag just needs to specify a hash tag followed by the ID of the view to navigate to as shown in this jsFiddle (notice the href of the <a> tag matches the id of the second view):   Direct link to jsFiddle: here. That is all well and good but the problem I encountered was: how to pass data between the views? Specifically, I need the detail view to display all the details of whichever task was selected. If I was doing this with my typical technique with KnockoutJS, I know exactly what I would do. First I would create a view model that had my collection of tasks and a property for the currently selected task like this: 1: function ViewModel() { 2: var self = this; 3: self.tasks = ko.observableArray(data); 4: self.selectedTask = ko.observable(null); 5: } Then I would bind my list of tasks to the unordered list - I would attach a “click” handler to each item (each <li> in the unordered list) so that it would select the “selectedTask” for the view model. The problem I found is this approach simply wouldn’t work for Kendo UI Mobile. It completely ignored the click handlers that I was trying to attach to the <a> tags – it just wanted to look at the href (at least that’s what I observed). But if I can’t intercept this, then *how* can I pass data or any context to the next view? The only thing I was able to find in the Kendo documentation is that you can pass query string arguments on the view name you’re specifying in the href. This enabled me to do the following: Specify the task ID in each href – something like this: <a href=”#taskDetail?id=3></a> Attach an “init method” (via the “data-show” attribute on the details view) that runs whenever the view is activated Inside this “init method”, grab the task ID passed from the query string to look up the item from my view model’s list of tasks in order to set the selected task I was able to get all that working with about 20 lines of JavaScript as shown in this jsFiddle. If you click on the Results tab, you can navigate between views and see the the detail screen is correctly binding to the selected item:   Direct link to jsFiddle: here.   With all that being done, I was very happy to get it working with the behavior I wanted. However, I have no idea if that is the “correct” way to do it or if there is a “better” way to do it. I know that Kendo UI comes with its own data binding framework but my preference is to be able to use (the well-documented) KnockoutJS since I’m already familiar with that framework rather than having to learn yet another new framework. While I think my solution above is probably “acceptable”, there are still a couple of things that bug me about it. First, it seems odd that I have to loop through my items to *find* my selected item based on the ID that was passed on the query string - normally, with Knockout I can just refer directly to my selected item from where it was used. Second, it didn’t feel exactly right that I had to rely on the “data-show” method of the details view to set my context – normally with Knockout, I could just attach a click handler to the <a> tag that was actually clicked by the user in order to set the “selected item.” I’m not sure if I’m being too picky. I know there are many people that have *way* more expertise in Kendo UI compared to me – I’d be curious to know if there are better ways to achieve the same results.

    Read the article

  • Using jquery validate with multiple fields of the same name

    - by Matt H
    I am trying to get jquery validate to work on multiple fields. Reason being I have dynamically generated fields added and they are simply a list of numbers. So I thought I'd put together a basic example and followed the concept from the accepted answer in the following link: http://stackoverflow.com/questions/931687/using-jquery-validate-plugin-to-validate-multiple-form-fields-with-identical-name However, it's not doing anything useful. Why is it not working? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/validate/lib/jquery.delegate.js"></script> <script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/validate/jquery.validate.js"></script> <script> $("#submit").click(function(){ $("field").each(function(){ $(this).rules("add", { required: true, email: true, messages: { required: "Specify a valid email" } }); }) }); $(document).ready(function(){ $("#myform").validate(); }); </script> </head> <body> <form id="myform"> <label for="field">Required, email: </label> <input class="left" id="field" name="field" /> <input class="left" id="field" name="field" /> <input class="left" id="field" name="field" /> <input class="left" id="field" name="field" /> <br/> <input type="submit" value="Validate!" id="submit" name="submit" /> </form> </body> </html>

    Read the article

  • jQuery 1.4 Dynamically created images aspect ratio incorrect in IE8 and max-width

    - by Chris
    After upgrading to jQuery 1.4, when I try to add an image to a page dynamically using jQuery 1.4 in IE8, the image will lose the correct aspect ratio. This appears to affect only IE8 (IE7 and Firefox work fine) with jQuery 1.4 (1.3.2 works fine). Including the jQuery compatability file does not fix the problem. <!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> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" language="javascript" type="text/javascript"></script> <!-- Switching to 1.3.2 fixes the problem --> <!--<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" language="javascript" type="text/javascript"></script>--> <script type="text/javascript"> $(document).ready(function() { var dynImg = $('<img></img>').attr('src', 'http://www.google.com/intl/en_ALL/images/logo.gif'); $('body').append(dynImg); }); </script> <style type="text/css"> img { max-width: 5em; } </style> </head> <body></body></html>

    Read the article

  • jQuery .load() and sub-pages

    - by user354051
    Hi, I am not just a newbie with Javascript. I am developing a simple site to get my hands on web programming. The web site is simple and structure is like this: A simple ul/li/css based navigation menu Sub pages are loaded in "div" using jQuery, when ever user click appropriate menu item. Some of the sub-pages are using different jQuery based plugins such as LightWindow, jTip etc. The jQuery function that loads the sub-page is like this: function loadContent(htmlfile){ jQuery("#content").load(htmlfile); }; The menu items fires loadContent method like this: <li><a href="javascript:void(0)" onclick="loadContent('overview.html');return false">overview</a></li> This loads a sub-page name "overview.html" inside the "div". That's it. Now this is working fine but some of the sub-pages using jQuery based plugins are not working well when loaded inside the "div". If you load them individually in the browser they are working fine. Based on above I have few qustions: Most of the plugins are based on jQuery and sub-pages are loaded inside the "index.html" using "loadContent" function. Do I have to call <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script> on each and every sub-page? If a page is using a custom jQuery plugin, then where do I call it? In "index.html" or on the page where I am using it? I think what ever script you will call in "index.html", you don't to have call them again in any of the sub pages you are using. Am I right here? Thanks Prashant

    Read the article

  • jQuery problem with change event and IE8

    - by Marcus
    There is a bug in jQuery 1.4.2 that makes change event on select-element getting fired twice when using both DOM-event and a jQuery event, and this only on IE7/8. Here is the test code: <html> <head> <script src="http://code.jquery.com/jquery-1.4.2.js" type="text/javascript"></script> <script type="text/javascript"> jQuery(document).ready(function() { jQuery(".myDropDown").change(function() { }); }); </script> </head> <body> <select class="myDropDown" onchange="alert('hello');"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> </select> </body> </html> Ticket to actual bug: http://dev.jquery.com/ticket/6593 This causes alot of trouble for us in our application cause we use both ASP.NET-events mixed with jQuery and once you hook up a change event on any element every select (dropdown) gets this double firing problem. Is there anyone who knows a way around this in the meantime until this issue is fixed?

    Read the article

  • error handler isn't called when file is uploaded via ajax using jQuery form plugin

    - by scompt.com
    Here's my test case. If the form is posted, a 500 error response is sent. If not, the form is sent. If the file input tag is commented out, the error handler is called. If the file input tag is present, the error handler isn't called. I think this might have something to do with the fact that jQuery needs to use an iframe to handle the upload and iframes don't seem to respond to the error handler. Edit: If I add iframe: true to the options passed to ajaxSubmit to force the use of an iframe, the non-file-upload case stops working also, so it definitely has to do with the iframe. Edit2: I'm using the jQuery Form Plugin. <?php if($_SERVER['REQUEST_METHOD'] == 'POST') { header('HTTP/1.1 500 Internal Server Error'); die; } else {?> <html><head> <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js?ver=2.9.2'></script> <script type='text/javascript' src='http://github.com/malsup/form/raw/master/jquery.form.js?v2.43'></script> <script type="text/javascript"> jQuery(document).ready(function() { jQuery('a').click(function() {jQuery('form').ajaxSubmit({error: function(){alert('error handler called');}})}); }); </script> </head><body> <form method="POST"> <input type="text" name="mytext" /> <input type="file" name="myfile" /><!-- comment this element out --> <input type="hidden" name="blah" value="blah" /> <a>submit</a> </form> </body></html> <?php } Is there any way to get the error handler to be called in both situations?

    Read the article

  • Which is the best jQuery-powered site?

    - by Reigel
    This "Top 10 JavaScript (jQuery) Powered Sites", posted about 2 years ago, was the one that invites me(after seeing the list) to use jQuery. All the sites in that list made me realize how cool it is to build sites powered by jQuery. And now more and more sites are being powered by jQuery. More and more developers are learning jQuery. Two years have past now but I still do a search to google for best sites and still got me to that link and which the link is not updated from the first time I have looked at it. Here at stackoverflow, there are lots of jQuery user. I was thinking if we can here show some of the sites that you know that is powered by jQuery which you think is best. If you can, please make it one site one answer, so that we can make a vote if it's really best jQuery powered site. We will take a look if it is really well implemented ( the way the codes are written, fast speed site, etc...) and deserves to be the best. Lot's of viewers will benefit from it. Like, we can view and have an idea of how we will make our next project cooler, faster, and powerful.

    Read the article

< Previous Page | 86 87 88 89 90 91 92 93 94 95 96 97  | Next Page >