Search Results

Search found 21127 results on 846 pages for 'jquery ajax'.

Page 8/846 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Loading dynamic content and rewrite URL on Hashchange event with Jquery Mobile

    - by user3611500
    I'm building a mobile version for my website using Jquery Mobile API. The framework provides automate AJAX navigation processing. But as far as i know it require "real" pages for loading purpose. What i want to do is override the automate navigation process of it and process the hashchange on my own. But i can't not rewrite the url using window.hashChange, which is running well on my non-mobile website version : $(function () { $(window).off().hashchange(function () { if (location.hash.length > 1) { PageSelect(); } }); $(window).hashchange(); }); I just only want to take advantage on jquery mobile interfaces, i don't want anything with its automate ajax navigation stuff ! I tried to disable it using ajaxEnabled() but got no luck.

    Read the article

  • Looking into the JQuery Image Zoom Plugin

    - by nikolaosk
    I have been using JQuery for a couple of years now and it has helped me to solve many problems on the client side of web development.  You can find all my posts about JQuery in this link. In this post I will be providing you with a hands-on example on the JQuery Image Zoom Plugin.If you want you can have a look at this post, where I describe the JQuery Cycle Plugin.You can find another post of mine talking about the JQuery Carousel Lite Plugin here.I will be writing more posts regarding the most commonly used JQuery Plugins. I have been using extensively this plugin in my websites.You can use this plugin to move mouse around an image and see a zoomed in version of a portion of it. In this hands-on example I will be using Expression Web 4.0.This application is not a free application. You can use any HTML editor you like. You can use Visual Studio 2012 Express edition. You can download it here.  You can download this plugin from this link I launch Expression Web 4.0 and then I type the following HTML markup (I am using HTML 5) <html lang="en">  <head>    <title>Liverpool Legends</title>        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >        <link rel="stylesheet" type="text/css" href="style.css">        <script type="text/javascript" src="jquery-1.8.3.min.js"> </script>     <script type="text/javascript" src="jqzoom.pack.1.0.1.js"></script>        <script type="text/javascript">        $(function () {            $(".nicezoom").jqzoom();        });    </script>       </head>  <body>    <header>        <h1>Liverpool Legends</h1>    </header>        <div id="main">            <a href="championsofeurope-large.jpg" class="nicezoom" title="Champions">        <img src="championsofeurope.jpg"  title="Champions">    </a>          </div>            <footer>        <p>All Rights Reserved</p>      </footer>     </body>  </html>   This is a very simple markup. I have added one large and one small image (make sure you use your own when trying this example) I have added references to the JQuery library (current version is 1.8.3) and the JQuery Image Zoom Plugin. Then I add 2 images in the main div element.Note the class nicezoom inside the href element. The Javascript code that makes it all happen follows.    <script type="text/javascript">        $(function () {            $(".nicezoom").jqzoom();        });    </script>     It couldn't be any simpler than that. I view my simple in Internet Explorer 10 and it works as expected. I have tested this simple solution in all major browsers and it works fine.Inside the head section we can add another Javascript script utilising some more options regarding the zoom plugin.   <script type="text/javascript">            $(function () {        var options = {                  zoomType: 'standard',                  lens:true,                  preloadImages: true,                  alwaysOn:false,                  zoomWidth: 400,                  zoomHeight: 350,                  xOffset:190,                  yOffset:80,                  position:'right'                          };          $('.nicezoom').jqzoom(options);      });         </script> I would like to explain briefly what some of those options mean. zoomType - Other admitted option values are 'reverse','drag','innerzoom' zoomWidth - The popup window width showing the zoomed area zoomHeight - The popup window height showing the zoomed area xOffset - The popup window x offset from the small image.  yOffset - The popup window y offset from the small image.  position - The popup window position.Admitted values:'right' ,'left' ,'top' ,'bottom' preloadImages - if set to true,jqzoom will preload large images. You can test it yourself and see the results in your favorite browser. Hope it helps!!!

    Read the article

  • Javascript not able to read data generated by ajax script

    - by user1371033
    I have a situation in which my Jquery Ajax script generates HTML table. And another script is meant to filter the table column by providing a dropdown comprising of unique values in that particular column. If i have static content in html page the filter script works fine. But is not able to read table content when it is generated via Ajax that is during runtime. Any idea what could be the reason. I also tried to align script in order. My Ajax script is here:- $(document).ready(function() { $("#getResults").click(function(){ bug = $("#bug").val(); priority = $("#priority").val(); component = $("#component").val(); fixVersion = $("#fixVersion").val(); dateType = $("#dateType").val(); fromDate = $("#dp2").val(); toDate = $("#dp3").val(); $("#query").empty(); $("tbody").empty(); $.post("getRefineSearchResultsPath", {bug:bug,priority:priority,component:component, fixVersion:fixVersion,dateType:dateType,fromDate:fromDate,toDate:toDate }, function(data) { // setting value for csv report button //clear the value attribute for button first $("#query_csv").removeAttr("value"); //setting new value to "value" attribute of the csv button $("#query_csv").attr("value", function(){ return $(data).find("query").text(); }); $("#query").append("<p class='text-success'>Query<legend></legend><small>" +$(data).find("query").text() +"</small></p>"); var count = 1; $(data).find("issue").each(function(){ var $issue = $(this); var value = "<tr>"; value += "<td>" +count +"</td>"; value += "<td>" +$issue.find('issueKey').text() +"</td>"; value += "<td>" +$issue.find('type').text() +"</td>"; value += "<td><div id='list' class='summary'>" +$issue.find('summary').text() +"</div></td>"; value += "<td><div id='list' class='mousescroll'>" +$issue.find('description').text() +"</div></td>"; value += "<td>" +$issue.find('priority').text() +"</td>"; value += "<td>" +$issue.find('component').text() +"</td>"; value += "<td>" +$issue.find('status').text() +"</td>"; value += "<td>" +$issue.find('fixVersion').text() +"</td>"; value += "<td>" +$issue.find('resolution').text() +"</td>"; value += "<td>" +$issue.find('created').text() +"</td>"; value += "<td>" +$issue.find('updated').text() +"</td>"; value += "<td>" +$issue.find('os').text() +"</td>"; value += "<td>" +$issue.find('frequency').text() +"</td>"; value += "<td>"; var number_of_attachement = $issue.find('attachment').size(); if(number_of_attachement > 0){ value += "<div id='list' class='attachment'>"; value += "<ul class='unstyled'>"; $issue.find('attachment').each(function(){ var $attachment = $(this); value += "<li>"; value += "<a href='#' onclick='document.f1.attachmentName.value='" +$attachment.find('attachmentName').text(); value += "';document.f1.issueKey.value='"+$attachment.find('attachmentissueKey').text(); value += "';document.f1.digest.value='"+$attachment.find('attachmentdigest').text(); value += "';document.f1.submit();'>"+$attachment.find('attachmentName').text(); value += "</a>"; value += "</li>"; value += "<br>"; }); value +="</ul>"; value +="</div>"; } value += "</td>"; value += "</tr>"; $("tbody").append(value); count++; }); }); }); }); And my script to filter table is here, I got this script from this link http://www.javascripttoolbox.com/lib/table/ My JSP page is here:- <html> <body> <table class="table table-bordered table-condensed table-hover example sort01 table-autosort:0 table-autofilter table-autopage:10 table-page-number:t1page table-page-count:t1pages table-filtered-rowcount:t1filtercount table-rowcount:t1allcount"> <thead > <tr> <th class="table-sortable:numeric" Style="width:3%;">No.</th> <th class="table-sortable:default" Style="width:5.5%;">Issue Key <br> </th> <th>Type</th> <th Style="text-align: center;">Summary</th> <th Style="text-align: center;">Description</th> <th class="table-filterable table-sortable:default" id ="priorityColumn" Style="width:5%">Priority</th> <th class="table-filterable table-sortable:default" >Component</th> <th class="table-filterable table-sortable:default" Style="width:5%">Status</th> <th class="table-filterable table-sortable:default">Fix Version</th> <th class="table-filterable table-sortable:default" Style="width:6%">Resolution</th> <th>Created</th> <th>Updated</th> <th>OS</th> <th>Frequency</th> <th>Attachments</th> </tr> </thead> <tbody> </tbody> <tfoot> <tr> <td class="table-page:previous" style="cursor:pointer;"><img src="table/icons/previous.gif" alt="Previous"><small>Prev</small></td> <td colspan="13" style="text-align:center;">Page <span id="t1page"></span>&nbsp;of <span id="t1pages"></span></td> <td class="table-page:next" style="cursor:pointer;">Next <img src="table/icons/next.gif" alt="Previous"></td> </tr> <tr Style="background-color: #dddddd"> <td colspan="15"><span id="t1filtercount"></span>&nbsp;of <span id="t1allcount"></span>&nbsp;rows match filter(s)</td> </tr> <tr class="text-success"> <td colspan="15">Total Results : ${count}</td> </tr> </tfoot> </table> </body> </html>

    Read the article

  • How to run javascript on an ajax output?

    - by WAC0020
    I am using jquery-ui tabs and ajax to load the content of the tabs. Here is my javascript: $(document).ready(function() { $("#tabs").tabs({ fx: { opacity: 'toggle' } }); $('.hd_item').hover(function() { //Display the caption $(this).find('span.hd_caption').stop(false,true).fadeIn(600); }, function() { //Hide the caption $(this).find('span.hd_caption').stop(false,true).fadeOut(400); }); }); When the user clicks on the tab is will load the content.php via ajax. The output of the ajax is: <li class="hd_item"> <img title="Backyard Brawl" alt="Backyard Brawl" src="games/normal_icons/1844.png" id="hd_icon"> <span class="hd_caption"> <h1>Backyard Brawl</h1> <p id="hd_description">In this game you pick a player and beat each other up with ...</p> <p id="hd_stat">Added: <br>2009-12-14</p><a href="/dirtpilegames/index.php?ground=games&amp;action=play&amp;dig=backyard-brawl">PLAY</a> </span> </li> The problem that I am having is the javascript is not working on the ajax output. How to I get it to work on it?

    Read the article

  • How to use jQuery .live() with ajax

    - by kylemac
    Currently I am using John Resig's LiveQuery plugin/function - http://ejohn.org/blog/jquery-livesearch/ - to allow users to sort through a long unordered-list of list-items. The code is as follows: $('input#q').liveUpdate('ul#teams').focus(); The issue arises when I use ajaxified tabs to sort the lists. Essentially I use ajax to pull in different lists and the liveUpdate() function doesn't have access to the new li's. I assume I would need to bind this using the .live() function - http://api.jquery.com/live/. But I am unclear how to bind this to an ajax event, I've only used the "click" event. How would I bind the new liveUpdate() to the newly loaded list-items? EDIT: The ajax tabs is run through the wordpress ajax api so the code is fairly complex, but simplified it is something like this: $('div.item-list-tabs').click( function(event) { var target = $(event.target).parent(); var data = {action, scope, pagination}; // Passes action to WP that loads my tab data $.post( ajaxurl, data, function(response) { $(target).fadeOut( 100, function() { $(this).html(response); $(this).fadeIn(100); }); }); return false; }); This is simplified for the sake of this conversation, but basically once the $.post loads the response in place .liveUpdate() doesn't have access to it. I believe the .live() function is the answer to this problem, I'm just unclear on how to implement it with the $.post()

    Read the article

  • jquery.ui.draggable.js and jquery.ui.widget.js conflict

    - by Daniel S
    hello I had a working application, which uses a jquery ui dialog. I wanted to make the dialog draggable. As far as I know the only thing needed is the jquery.ui.draggable.js script. So I added it to the scripts I am using, but know I get the following error (as shown in the firebug console): base is not a constructor The relevante line in jquery.ui.widget.js is: var basePrototype = new base(); This is how I am adding all the scripts: <script type="text/javascript" src="/media/development-bundle/jquery-1.4.2.js"></script> <script type="text/javascript" src="/media/development-bundle/ui/jquery.ui.core.js"></script> <script type="text/javascript" src="/media/development-bundle/ui/jquery.ui.widget.js"></script> <script type="text/javascript" src="/media/development-bundle/ui/jquery.ui.draggable.js"></script> <script type="text/javascript" src="/media/development-bundle/ui/jquery.ui.position.js"></script> <script type="text/javascript" src="/media/development-bundle/ui/jquery.ui.autocomplete.js"></script> <script type="text/javascript" src="/media/development-bundle/ui/jquery.ui.dialog.js"></script> Am I doing something wrong? or is this a problem with jquery? Thanks in advance for any help

    Read the article

  • jquery ajax and php arrays

    - by sea_1987
    Hi There, I am trying to submit some data to a PHP script, however the PHP scripts expects the data to arrive in a specific format, like this example which is a dump of the post, Array ( [save] => Add to shortlist [cv_file] => Array ( [849709537] => Y [849709616] => Y [849709633] => Y ) ) The process is currently that a user selects the product they want using checkboxes and then clicks a submit button which fires the PHP scripts, The HTML looks like this, div class="row"> <ul> <li class="drag_check ui-draggable"> <input type="checkbox" id="inp_cv_849709537" name="cv_file[849709537]" class="cv_choice" value="Y"> </li> <li class="id"><a href="/search/cv/849709537">849709537</a></li> <div class="disp"> <li class="location">Huddersfield</li> <li class="status"> Not currently working </li> <li class="education">other</li> <li class="role"> Temporary </li> <li class="salary">£100,000 or more</li> <div class="s">&nbsp;</div> </div> </ul> <dl> <dt>Current Role</dt> <dd>Developer </dd> <dt>Sectors</dt><dt> </dt><dd> Energy &amp; Utilities, Healthcare, Hospitality &amp; Travel, Installation &amp; Maintenance, Installation &amp; Maintenance </dd> <dt>About Me</dt><dt> </dt><dd></dd> </dl> <div class="s"></div> </div> I am needing to use AJAX instead now, but I need to send the data to PHP in the format it expects here is what I have so far, $('#addshortlist').click(function() { var datastring = ui.draggable.children().attr('name')+"="+ui.draggable.children().val()+"&save=Add to shortlist"; alert(datastring); $.ajax({ type: 'POST', url: '/search', data:ui.draggable.children().attr('name')+"="+ui.draggable.children().val()+"&save=Add to shortlist", success:function(){ alert("Success"+datastring); }, error:function() { alert("Fail"+datastring); } }); return false; }); I would really appreciate any help

    Read the article

  • JQuery Autocomplete plugin not working with JQuery 1.4.1

    - by Russ Clark
    I've been using the JQuery Autocomplete plugin with JQuery version 1.3.2, and it has been working great. I recently updated JQuery in my project to version 1.4.2, and the Autocomplete plugin is now broken. The JQuery code to add items to a textbox on my web page doesn't seem to be getting called at all. Does anyone know if the JQuery Autocomplete plugin is incompatible with JQuery version 1.4.2, and if there is a fix for this problem? Here is some sample code I've built in an ASP.Net web site (which works fine if I change the JQuery file to jquery-1.3.2.js, but nothing happens using jquery-1.4.2.js): <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!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 runat="server"> <title>Untitled Page</title> <script type="text/javascript" src="js/jquery-1.4.2.js" ></script> <script type="text/javascript" src="js/jquery.autocomplete.js" ></script> <script type="text/javascript"> $(document).ready(function() { var data = "Core Selectors Attributes Traversing Manipulation CSS Events Effects Ajax Utilities".split(" "); $(':input:text:id$=sapleUser').autocomplete(data); }); </script> </head> <body> <form id="form1" runat="server"> API Reference: <input id="sapleUser" autocomplete="off" type="text" runat="server" /> (try "C" or "E") </form> </body> </html>

    Read the article

  • passing parameters to jQuery's select2 ajax call

    - by Cary
    I'm attempting to pass an extra parameter to an ajax call within select2: $(".auto-sug").select2({ width:'element', minimumInputLength:2, ajax: { url: "/action/get-custom.php", data: function (term, page) { return { q: term, // search term page_limit: 10 }; }, results: function (data, page) { return {results: data.stuff}; } } }); I actually want to pass another parameter to the ajax call... the id of the element itself <input type="text" class="auto-sug" name="custom" id="3383" /> however, I'm unable to figure out how to actually access the id of the element (3383) or any other value on the page. select2: http://ivaynberg.github.com/select2/

    Read the article

  • Creating a new record using AJAX in ASP.NET-MVC

    - by RememberME
    I am having the hardest time wrapping my head around this. I recently asked this question Create/Edit/Save data in a jQuery pop-up for ASP.NET-MVC and Linq2Sql I'm sure that the response is the right way to go, but I just can't figure out how to write the back-end code to make it work. I originally made my site by following the nerddinner tutorial. I have a subcontracts model and a subcontracts controller. On my subcontract entry page, I'd like for there to be a pop-up/dialog box where the user can enter a new company if the company isn't already in the drop-down list. Do I need to create a new company controller? I wouldn't have a company model b/c the company table is linked to my subcontracts table within the subcontracts dbml. Can anyone point me to an example somewhere? Or offer any help.

    Read the article

  • showing progressbar progress with ajax request

    - by Ygam
    Hi guys! I want to show progress with jquery ui progress bar when an ajax request fires and when it finishes. The problem is I don't know how to set values for the progress bar depending on the progress of the ajax request. Please hlep. Here's a code to start with: function ajaxnews() { $('.newstabs a').click(function(e){ var section = $(this).attr('id'); var url = base + 'news/section/' + section; $.ajax({ url : url, dataTye : 'html', start : loadNews, success : fillNews }); }); } // start callback functions function loadNews() { $('#progressbar').fadeIn(); $('#progressbar').progressbar({ //how shoud I set the values here}); } function fillNews() { $('#progressbar').progressbar('option', 'value', ?? /* how do I find this?*/); $('#progressbar').fadeOut(); }

    Read the article

  • migrating from Prototype to jQuery in Rails, having trouble with duplicate get request

    - by aressidi
    I'm in the process of migrating from Prototype to jQuery and moving all JS outside of the view files. All is going fairly well with one exception. Here's what I'm trying to do, and the problem I'm having. I have a diary where users can update records in-line in the page like so: user clicks 'edit' link to edit an entry in the diary a get request is performed via jQuery and an edit form is displayed allowing the user to modify the record user updates the record, the form disappears and the updated record is shown in place of the form All of that works so far. The problem arises when: user updates a record user clicks 'edit' to update another record in this case, the edit form is shown twice! In firebug I get a status code 200 when the form shows, and then moments later, another edit form shows again with a status code of 304 I only want the form to show once, not twice. The form shows twice only after I update a record, otherwise everything works fine. Here's the code, any ideas? I think this might have to do with the fact that in food_item_update.js I call the editDiaryEntry() after a record is updated, but if I don't call that function and try and update the record after it's been modified, then it just spits up the .js.erb response on the screen. That's also why I have the editDiaryEntry() in the add_food.js.erb file. Any help would be greatly appreciated. diary.js jQuery(document).ready(function() { postFoodEntry(); editDiaryEntry(); initDatePicker(); }); function postFoodEntry() { jQuery('form#add_entry').submit(function(e) { e.preventDefault(); jQuery.post(this.action, jQuery(this).serialize(), null, "script"); // return this }); } function editDiaryEntry() { jQuery('.edit_link').click(function(e) { e.preventDefault(); // This should look to see if one version of this is open... if (jQuery('#edit_container_' + this.id).length == 0 ) { jQuery.get('/diary/entry/edit', {id: this.id}, null, "script"); } }); } function closeEdit () { jQuery('.close_edit').click(function(e) { e.preventDefault(); jQuery('.entry_edit_container').remove(); jQuery("#entry_" + this.id).show(); }); } function updateDiaryEntry() { jQuery('.edit_entry_form').submit(function(e) { e.preventDefault(); jQuery.post(this.action, $(this).serialize(), null, "script"); }); } function initDatePicker() { jQuery("#date, #edit_date").datepicker(); }; add_food.js.erb jQuery("#entry_alert").show(); jQuery('#add_entry')[ 0 ].reset(); jQuery('#diary_entries').html("<%= escape_javascript(render :partial => 'members/diary/diary_entries', :object => @diary, :locals => {:record_counter => 0, :date_header => 0, :edit_mode => @diary_edit}, :layout => false ) %>"); jQuery('#entry_alert').html("<%= escape_javascript(render :partial => 'members/diary/entry_alert', :locals => {:type => @type, :message => @alert_message}) %>"); jQuery('#entry_alert').show(); setTimeout(function() { jQuery('#entry_alert').fadeOut('slow'); }, 5000); editDiaryEntry(); food_item_edit.js.erb jQuery("#entry_<%= @entry.id %>").hide(); jQuery("#entry_<%= @entry.id %>").after("<%= escape_javascript(render :partial => 'members/diary/food_item_edit', :locals => {:user_food_profile => @entry}) %>"); closeEdit(); updateDiaryEntry(); initDatePicker(); food_item_update.js jQuery("#entry_<%= @entry.id %>").replaceWith("<%= escape_javascript(render :partial => 'members/diary/food_item', :locals => {:entry => @entry, :total_calories => 0}) %>"); jQuery('.entry_edit_container').remove(); editDiaryEntry();

    Read the article

  • Internet explorer only executing function inside jQuery ajax success response once even though there

    - by user249950
    Hi, I have a function that uses jQuery.load() to call in 3 snippets of forms from different pages and then on the success text status it tries to load a colour picker: $(document).ready(function() { function ajax_form(putloadingboxhere, putsnippethere, snippeturl) { $(putsnippethere).load(snippeturl, function (responseText, textStatus, XMLHttpRequest, ) { if (textStatus == "success") { alert('One') $("input.pickcolor").ColorPicker({ onShow: function (colpkr) { $(colpkr).fadeIn(500); return false; }, onSubmit: function(hsb, hex, rgb, el) { $(el).val(hex); $(el).ColorPickerHide(); $(el).siblings('.colorpreview').css('background-color', '#' + hex); }, onBeforeShow: function () { $(this).ColorPickerSetColor(this.value); } }) .bind('keyup', function(){ $(this).ColorPickerSetColor(this.value); }); alert('Two') } if (textStatus == "error") { // Show error message } }); } ajax_form('tab_box', '#formone', 'snippet_one.htm #snippet'); ajax_form('tab_box', '#formtwo', 'snippet_two_copy.htm #snippet'); ajax_form('tab_box', '#formthree', 'snippet_three.htm #snippet'); }); It works fine in Firefox and Safari but (surprise, surprise) IE has a problem with it. I have added an alert to see what is going on before and after one of the functions. FF & Safari & IE8: Alert 'one' and Alert 'two' appear three times as expected and colour picker appears. IE6 & 7: Alert 'one' shows three times and colour picker does not appear. Any help would be great! Cheers. EDIT The line IE is referring to when it throws this error: 'Error: Object doesn't support this property or method.' is: $('input.pickcolor').ColorPicker Anyone got any insights? Thanks

    Read the article

  • calling Valums Ajax uploader from other DOM element

    - by Marc
    I'm facing a problem with the valums Ajax File upload. Since the plugin is working perfectly after a few modifications on the server side, I cannot implement a specific behavior. My DOM is composed with an input file plus the container to instantiate the fileuploader buttons. What I want is to be able to fire the fileuploader plugins when clicking on the input:file[name="upload-file"]. ... <div id="upload-accepted"> <fieldset> <label for="upload-file">Select a file:</label> <input type="file" name="upload-file" id="upload-file"/> <noscript> <p>Please enable JavaScript to use file uploader.</p> </noscript> </fieldset> <div id="upload-container"> </div> </div> ... <script type="text/javascript"> $(function() { var uploader = new qq.FileUploader({ action: '/file-upload', element: document.getElementById('upload-container'), onSubmit: function(id, filename){...}, onComplete: function(id, fileName, responseJSON){...} }); }); </script> I have tried to add the following on the script but it don't works $("#upload-file").live('change', function(event) { event.preventDefault(); $('.qq-upload-button').trigger('click'); return false; }); Any clues? Thanks in advance!

    Read the article

  • Firefox crashes with mulitple Uploadify JQuery browse buttons and ajax

    - by droidy
    Hi, I'm using four JQuery Uploadify browse buttons on a page that's calling the Uploadify code/buttons through Ajax. We have a javascript function called from onComplete which refreshes the Ajax page. The problem we're encountering is that when you start uploading one file, if you click browse to upload another file, Firefox will crash when selecting the second file. Any help is appreciated. Thanks!

    Read the article

  • load google annotated chart within jquery ui tab content via ajax method

    - by twmulloy
    Hi, I am encountering an issue with trying to load a google annotated chart (http://code.google.com/apis/visualization/documentation/gallery/annotatedtimeline.html) within a jquery ui tab using content via ajax method (http://jqueryui.com/demos/tabs/#ajax). If instead I use the default tabs functionality, writing out the code things work fine: <div id="tabs"> <ul> <li><a href="#tabs-1">Chart</a></li> </ul> <div id="tabs-1"> <script type="text/javascript"> google.load('visualization', '1', {'packages':['annotatedtimeline']}); google.setOnLoadCallback(drawChart); function drawChart() { var data = new google.visualization.DataTable(); data.addColumn('date', 'Date'); data.addColumn('number', 'cloudofinc.com'); data.addColumn('string', 'header'); data.addColumn('string', 'text') data.addColumn('number', 'All Clients'); data.addRows([ [new Date('May 12, 2010'), 2, '2 New Users', '', 3], [new Date('May 13, 2010'), 0, undefined, undefined, 0], [new Date('May 14, 2010'), 0, undefined, undefined, 0], ]); var chart = new google.visualization.AnnotatedTimeLine(document.getElementById('chart_users')); chart.draw(data, { displayAnnotations: false, fill: 10, thickness: 1 }); } </script> <div id='chart_users' style='width: 100%; height: 400px;'></div> </div> </div> But if I use the ajax method for jquery ui tab and point to the partial for the tab, it doesn't work completely. The page renders and once the chart loads, the browser window goes white. However, you can see the tab partial flash just before the chart appears to finish rendering (the chart never actually displays). I have verified that the partial is indeed loading properly without the chart. <div id="tabs"> <ul> <li><a href="ajax/tabs-1">Chart</a></li> </ul> </div>

    Read the article

  • JQuery username validation - Ajax call

    - by Denise
    Hi, I am currently using JQuery's validation plugin for basic form validation such as required fields. I want to add functionality so that when the user types in the username field, an ajax call is triggered to check whether the username is already taken. My requirements are: Preferably integrate with JQuery Validation plugin, rather than writing a custom function I want the lookup to occur on the nkeyup event I want the lookup to be triggered approx 0.5 seconds after the keyup event has occurred. Thanks!

    Read the article

  • Loading jQuery plugin defaults from the server (AJAX)

    - by Pablo
    Im working on a private jQuery plugin in the following format: (function( $ ){ var defaults = {}; $.fn.cmFlex = function(opts) { this.each(function() { //Element specific options var o = $.extend({}, defaults, opts); //Code here }); //code Here }; })( jQuery ); How will i go on loading the default options from the server before $.cmFlex() is first called?

    Read the article

  • Looking into the JQuery Carousel Lite Plugin

    - by nikolaosk
    I have been using JQuery for a couple of years now and it has helped me to solve many problems on the client side of web development. You can find all my posts about JQuery in this link. In this post I will be providing you with a hands-on example on the JQuery Carousel Lite Plugin.If you want you can have a look at this post, where I describe the JQuery Cycle Plugin. I will be writing more posts regarding the most commonly used JQuery Plugins. I have been using extensively this plugin in my websites.You can show a portion of a set of images with previous and next navigation.In this hands-on example I will be using Expression Web 4.0.This application is not a free application. You can use any HTML editor you like.You can use Visual Studio 2012 Express edition. You can download it here. You can download this plugin from this linkI launch Expression Web 4.0 and then I type the following HTML markup (I am using HTML 5)<html lang="en">  <head>    <title>Liverpool Legends</title>        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >        <link rel="stylesheet" type="text/css" href="style.css">        <script type="text/javascript" src="jquery-1.8.3.min.js"> </script>     <script type="text/javascript" src="jcarousellite_1.0.1.min.js"></script>      <script type="text/javascript">        $(function () {            $(".theImages").jCarouselLite({                btnNext: "#Nextbtn",                btnPrev: "#Previousbtn"            });        });    </script>       </head>  <body>    <header>        <h1>Liverpool Legends</h1>    </header>        <div id="main">           <img id="Previousbtn" src="previous.png" />        <div class="theImages">            <ul>                <li><img src="championsofeurope.jpg"></li>                <li><img src="steven_gerrard.jpg"></li>                <li><img src="ynwa.jpg"></li>                <li><img src="dalglish.jpg"></li>                <li><img src="Souness.jpg"></li>                  </ul>    </div>    <img id="Nextbtn" src="next.png" />          </div>            <footer>        <p>All Rights Reserved</p>      </footer>     </body>  </html>  This is a very simple markup. I have added my photos (make sure you use your own when trying this example)I have added references to the JQuery library (current version is 1.8.3) and the JQuery Carousel Lite Plugin. Then I add 5 images in the theImages div element.The Javascript code that makes it all happen follows.  <script type="text/javascript">        $(function () {            $(".theImages").jCarouselLite({                btnNext: "#Nextbtn",                btnPrev: "#Previousbtn"            });        });    </script>I also have added some basic CSS style rules in the style.css file. body{background-color:#efefef;color:#791d22;}       #Previousbtn{position:absolute; left:5px; top:100px;}#Nextbtn {position:absolute; left:812px; top:100px;}.theImages {margin-left:145px;margin-top:10px;} It couldn't be any simpler than that. I view my simple in Internet Explorer 10 and it works as expected.I have tested this simple solution in all major browsers and it works fine.Hope it helps!!!

    Read the article

  • Looking into the JQuery Cycle Plugin

    - by nikolaosk
    I have been using JQuery for a couple of years now and it has helped me to solve many problems on the client. You can find all my posts about JQuery in this link. In this post I will be providing you with a hands-on example on the JQuery Cycle Plugin.I have been using extensively this plugin in my websites.You can rotate a series of images using various transitions with this plugin.It is a slideshow type of experience. I will be writing more posts regarding the most commonly used JQuery Plugins.  In this hands-on example I will be using Expression Web 4.0.This application is not a free application. You can use any HTML editor you like.You can use Visual Studio 2012 Express edition. You can download it here.  You can download this plugin from this link I launch Expression Web 4.0 and then I type the following HTML markup (I am using HTML 5) <!DOCTYPE html><html lang="en">  <head>    <title>Liverpool Legends</title>        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >            <script type="text/javascript" src="jquery-1.8.3.min.js"> </script>     <script type="text/javascript" src="jquery.cycle.all.js"></script>              <script type="text/javascript">        $(function() {            $('#main').cycle({ fx: 'fade'});        });    </script>       </head>  <body>    <header>        <h1>Liverpool Legends</h1>    </header>        <div id="main">                   <img src="championsofeurope.jpg" alt="Champions of Europe">                        <img src="steven_gerrard.jpg" alt="Steven Gerrard">                        <img src="ynwa.jpg" alt="You will never walk alone">                       </div>            <footer>        <p>All Rights Reserved</p>      </footer>     </body>  </html> This is a very simple markup. I have added three photos (make sure you use your own when trying this example)I have added references to the JQuery library (current version is 1.8.3) and the JQuery Cycle Plugin. Then I have added 3 images in the main div element.The Javascript code that makes it all happen follows.  <script type="text/javascript">        $(function() {            $('#main').cycle({ fx: 'fade'});        });    </script>  It couldn't be any simpler than that. I view my simple in Internet Explorer 10 and it works as expected. I have this series of images transitioning one after the other using the "fade" effect. I have tested this simple solution in all major browsers and it works fine.We can have a different transition effect by changing the JS code. Have a look at the code below       <script type="text/javascript">        $(function() {            $('#main').cycle({                     fx: 'cover',        speed: 500,        timeout: 2000                        });        });    </script>   We set the speed to 500 milliseconds, that is the speed we want to have for the ‘cover’ transition.The timeout is set to two seconds which is the time the photo will show until the next transition will take place.We can customise this plugin further but this is a short introduction to the plugin.Hope it helps!!!

    Read the article

  • jQuery ajax not preloading images

    - by George Wiscombe
    I have a list of galleries, when you click on the title of a gallery it pulls in the contents (HTML with images). When the content is pulled in it preloads the html but not the images, any ideas? This is the JavaScript i'm using: $('#ajax-load').ajaxStart(function() { $(this).show(); }).ajaxStop(function() { $(this).hide();}); // PORTFOLIO SECTION // Hide project details on load $('.project > .details').hide(); // Slide details up / down on click $('.ajax > .header').click(function () { if ($(this).siblings(".details").is(":hidden")) { var detailUrl = $(this).find("a").attr("href"); var $details = $(this).siblings(".details"); $.ajax({ url: detailUrl, data: "", type: "GET", success: function(data) { $details.empty(); $details.html(data); $details.find("ul.project-nav").tabs($details.find(".pane"), {effect: 'fade'}); $details.slideDown("slow"); }}); } else {$(this).siblings(".details").slideUp();} return false; }); You can see this demonstrated at http://www.georgewiscombe.com Thanks in advance!

    Read the article

  • What is the "standard" JQuery treeview that most people use? It seems the most popular plugin isn't

    - by Pete Alvin
    I've chosen JQuery as my JavaScript library but now I'm a bit frustrated by the JQuery plugin site... the site kinda sucks... the plugin area isn't designed very well and I can only find a few treeviews. The one with the most votes (link text) isn't supported anymore. Can someone please point me to an industrial strength treeview? Desired Features: 1. stable 2. async / ajax would be nice 3. drag and drop nodes would be nice I've been delighted so far with JQueryUI--nice design. But, how come it doesn't come with a standard tree view? Pete

    Read the article

  • Jquery Accordion and Fading

    - by Slick Willis
    I am trying to create a jquery accordion that fades the header of the accordion out when the page is loaded then fades it in when the mouse hovers. The accordion also opens when the mouse hovers. I am able to get all of this working, the problem I am having is when the accordion opens the header moves away and the mouse is no longer on it to keep it lit. I would like the links to keep the header lit as well as if the mouse is on the header itself. Below is the code that I wrote for it. <html> <head <script type='text/javascript' src='http://accidentalwords.squarespace.com/storage/jquery/jquery-1.4.2.min.js'></script> <script type='text/javascript' src='http://accidentalwords.squarespace.com/storage/jquery/jquery-custom-181/jquery-ui-1.8.1.custom.min.js'></script> </head> <body bgcolor="black"> <style = "css/text"> .links { font-family: "Georgia", "Verdana", serif; line-height: 30px; margin-left: 20px; margin-top: 5px; } .Title { font-family: "Geneva", "Verdana", serif; font-weight: bold; font-size: 2em; text-align: left; font-variant: small-caps; border-bottom: solid 2px #25FF00; padding-bottom:5px; margin-bottom: 10px; } </style> <script type="text/javascript"> $(document).ready(function(){ $(".Title").fadeTo(1,0.25); $(".Title").hover(function () { $(this).stop().fadeTo(250,1) .closest(".Title").find(".links").fadeTo(250,0.75); }, function() { $(this).stop().fadeTo(250,0.25); }); }); $(function() { $("#accordion").accordion({ event: "mouseover" }); }); </script> <p>&nbsp</p> <div id="accordion"> <div class="Title"><a href="#"STYLE="TEXT-DECORATION: NONE; color: #25FF00;">Reference</a></div> <div class="links"> <a href="http://docs.jquery.com/Main_Page" STYLE="TEXT-DECORATION: NONE; color: #25FF00;">Jquery Documentation/Help</a><br> <a href="http://stackoverflow.com/" STYLE="TEXT-DECORATION: NONE; color: #25FF00;">Stack Overflow</a><br> <a href="http://www.w3schools.com/" STYLE="TEXT-DECORATION: NONE; color: #25FF00;">w3schools.com</a><br> </div> <div class="Title"><a href="#"STYLE="TEXT-DECORATION: NONE; color: #FF7200;">Gaming</a></div> <div class="links"> <a href="http://docs.jquery.com/Main_Page" STYLE="TEXT-DECORATION: NONE; color: #FF7200;">Jquery Documentation/Help</a><br> <a href="http://stackoverflow.com/" STYLE="TEXT-DECORATION: NONE; color: #FF7200;">Stack Overflow</a><br> <a href="http://www.w3schools.com/" STYLE="TEXT-DECORATION: NONE; color: #FF7200;">w3schools.com</a><br></div> <div class="Title"><a href="#"STYLE="TEXT-DECORATION: NONE; color: #00DEFF;">Grub</a></div> <div class="links"> <a href="http://docs.jquery.com/Main_Page" STYLE="TEXT-DECORATION: NONE; color: #00DEFF;">Jquery Documentation/Help</a><br> <a href="http://stackoverflow.com/" STYLE="TEXT-DECORATION: NONE; color: #00DEFF;">Stack Overflow</a><br> <a href="http://www.w3schools.com/" STYLE="TEXT-DECORATION: NONE; color: #00DEFF;">w3schools.com</a><br> </div> <div class="Title"><a href="#"STYLE="TEXT-DECORATION: NONE; color: #F8FF00;">Drinks</a></div> <div class="links"> <a href="http://docs.jquery.com/Main_Page" STYLE="TEXT-DECORATION: NONE; color: #F9FF00;">Jquery Documentation/Help</a><br> <a href="http://stackoverflow.com/" STYLE="TEXT-DECORATION: NONE; color: #F8FF00;">Stack Overflow</a><br> <a href="http://www.w3schools.com/" STYLE="TEXT-DECORATION: NONE; color: #F8FF00;">w3schools.com</a><br> </div> </div> </body> </html>

    Read the article

  • Injecting jQuery into a page fails when using Google AJAX Libraries API

    - by jakemcgraw
    I'd like to inject jQuery into a page using the Google AJAX Libraries API, I've come up with the following solution: http://my-domain.com/inject-jquery.js: ;((function(){ // Call this function once jQuery is available var func = function() { jQuery("body").prepend('<div>jQuery Rocks!</div>'); }; // Detect if page is already using jQuery if (!window.jQuery) { var done = false; var head = document.getElementsByTagName('head')[0]; var script = document.createElement("script"); script.src = "http://www.google.com/jsapi"; script.onload = script.onreadystatechange = function(){ // Once Google AJAX Libraries API is loaded ... if (!done && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete")) { done = true; // ... load jQuery ... window.google.load("jquery", "1", {callback:function(){ jQuery.noConflict(); // ... jQuery available, fire function. func(); }}); // Prevent IE memory leaking script.onload = script.onreadystatechange = null; head.removeChild(script); } } // Load Google AJAX Libraries API head.appendChild(script); // Page already using jQuery, fire function } else { func(); } })()); The script would then be included in a page on a separate domain: http://some-other-domain.com/page.html: <html> <head> <title>This is my page</title> </head> <body> <h1>This is my page.</h1> <script src="http://my-domain.com/inject-jquery.js"></script> </body> </html> In Firefox 3 I get the following error: Module: 'jquery' must be loaded before DOM onLoad! jsapi (line 16) The error appears to be specific to the Google AJAX Libraries API, as I've seen others use a jQuery bookmarklet to inject jQuery into the current page. My question: Is there a method for injecting the Google AJAX Libraries API / jQuery into a page regardless of the onload/onready state?

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >