Search Results

Search found 23364 results on 935 pages for 'jquery ui droppable'.

Page 114/935 | < Previous Page | 110 111 112 113 114 115 116 117 118 119 120 121  | Next Page >

  • Confirm box always displays first (javascript, jQuery, .Net)

    - by Jan-Frederik Carl
    Hello, I have a jQuery-Script to accomplish the following tasks: if a gridview in my form contains a row with a certain id, it has to be marked red. a confirm dialogue has to pop up to ask the user if he wants to do this or that. I built this code: if (response == "EntryInList") { $('#entryListContainer div table tbody tr').each(function() { if ($(this).attr('id') == 'entry_' + $('#<%= txtProductNumber.ClientID %>').val()) { $(this).css("color", "red"); } } ); if (!confirm("Entry already exists. Really overwrite?")) { jQuery('#<%= txtProductNumber.ClientID %>').val(''); jQuery('#<%= txtCount.ClientID %>').val(''); jQuery('#<%= txtProductNumber.ClientID %>').focus(); return false; } } As a result, the confirm box pops up first, without the row being turned red. Only after using the box, it becomes red. How would I get the row to be turned red at once? Another of my problems is that the confirm box denies my page to be scrolled down. But I would like to do this if the gridview is longer than the entire page.

    Read the article

  • Accessing jQuery objects in the module pattern

    - by Stewart
    Hello, Really getting in to javascript and looking around at some patterns. One I have come accross is the module pattern. Its seems like a nice way to think of chucks of functionality so I went ahead and tried to implement it with jQuery. I ran in to a snag though. Consider the following code <!DOCTYPE html> <html> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <title>index</title> <script type="text/javascript" charset="utf-8" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> <script type="text/javascript" charset="utf-8"> $(document).ready(function(){ var TestClass2 = (function(){ var someDiv; return { thisTest: function () { someDiv = document.createElement("div"); $(someDiv).append("#index"); $(someDiv).html("hello"); $(someDiv).addClass("test_class"); } } })(); TestClass2.thisTest(); }); </script> </head> <body id="index" onload=""> <div id="name"> this is content </div> </body> </html> The above code alerts the html content of the div and then adds a class. These both use jQuery methods. The problem is that the .html() method works fine however i can not add the class. No errors result and the class does not get added. What is happening here? Why is the class not getting added to the div?

    Read the article

  • jquery getjson works fine in mac, and fails in windows

    - by viper
    this code loads the data jQuery.ajax({ type: "GET", url: "getOptionsJson.php", cache: false, dataType: "json", data: "config_id="+config_id, success: function(json) { jQuery.extend(dataArr, json.ajax); jQuery.extend(opts, json.ajax2); printResult(config_id); }, error: function() { alert('Error. Please try again'); location.reload(); } }); this code generates it <?php header('Content-type: application/javascript'); echo json_encode(array( "ajax" => array(1 => "test", 2 => "test 2"), "ajax2" => array(1 => "test 3", 2 => "test 4") ); ?> when im working on mac, everything goes fine, but today i tried it on widnows, and it doesnt work. the code flows like its success, but opts and dataArr are null i tried all headers (application/json, text/html, etc) i checked if getOptionsJson.php is called correctly via mail function filnally firebug says that im getting response, but theres no content and file is just 1kb i tried even changing datatype to xml, still fails ie gives a hint, it says 'there's error on site' which reffers to 127 line of jquery file any idea?

    Read the article

  • Javascript and jQuery (Fancybox) question

    - by songdogtech
    Javascript and jQuery (Fancybox) question I'm using the Javascript function below for Twitter sharing (as well as other services; the function code is simplified to just Twitter for this question) that grabs the to-be-shared page URL and title and it is invoked in the link with onclick. That results in the Twitter share page loading in a pop up browser window, i.e.<img src="/images/twitter_16.png" onclick="share.tw()" /> In order to be consistent with other design aspects of the site, what I'd like to be able to do is have the Twitter share page open not in a standard browser window but in a Fancybox (jQuery) window. Fancybox can load an external page in an iFrame when the img or href link contains a class (in this case class="iframe" ) in the link and in the document ready function in the header. Right now, of course, when I give the iframe class to the link that also has the onclick share.tw(), I get two popups: one browser window popup with the correct Twitter share page loaded, and a Fancybox jQuery popup that shows a site 404. How can I change the function to use Fancybox to present the Twitter share page? Is that a correct way to approach it? Or is there a better way, such as implementing the share function in jQuery, too? Thanks... Javascript share function: var share = { tw:function(title,url) { this.share('http://twitter.com/home?status=##URL##+##TITLE##',title,url); }, share:function(tpl,title,url) { if(!url) url = encodeURIComponent(window.location); if(!title) title = encodeURIComponent(document.title); tpl = tpl.replace("##URL##",url); tpl = tpl.replace("##TITLE##",title); window.open(tpl,"sharewindow"+tpl.substr(6,15),"width=640,height=480"); } }; It is invoked, i.e.: <img src="/images/twitter_16.png" onclick="share.tw()" /> Fancybox function, invoked by adding class="iframe" in the img or href link $(".iframe").fancybox({ 'width' : '100%', 'height' : '100%', 'autoScale' : false, 'transitionIn' : 'none', 'transitionOut' : 'none', 'type' : 'iframe' });

    Read the article

  • jQuery + External javascript: How to embed videoplayer in div

    - by Dennis
    I just started with jQuery and so far I have a really good impression of the framework. But now I have a problem that I can't figure out on myself. I want to embed an external javascript file that loads a videoplayer and displays it. If I include the <script>...</script> directly in HTML it loads just fine. But when I try to load it with jQuery it has very different behaviors in several browsers but it doesn't work in a single one. Either the player is not loaded at all or it doesn't update the selected div but reloads the player on a blank page. This is the source: <html> <head> <style type="text/css"> div#test { width: 100%; height: 500px; margin: 10px auto; padding: 5px; border: 1px solid #777; background-color: #fbca93; text-align: center; } </style> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script> <script> $(document).ready(function(){ var video = "<script type=\'text\/javascript\' src=\'http:\/\/www.physicalfitnet.com\/video_syndication\/embed\/jssingle.aspx?vid=651&pub=9DF8233261D101B86368400385B8FF2E\'><\/script>"; $("div#test").html(video); }); </script> </head> <body> <div id="test"> Hi</div> </body> </html> I uploaded everything to http://kernast.de/test ... any help is appreciated. THX

    Read the article

  • jQuery: If, Else with buttons error

    - by Wipqozn
    I'm running into an odd error. I'm working in Django 1.2, and have implemented the commenting framework. I'm trying to attach a hide/show button to each comment field, but whenever click on a hide/show button, it behaves as if each hide/show button beneath it on the page was clicked. Here's the jQuery code: <input type="Button" id="hideShow" name="hide/show" value="Hide"></input> <script> $("#hideShow").click(function() { if($(this).val() == "Hide") { $("textarea").hide("fast"); $(this).val("Show"); } else { $("textarea").show("fast"); $(this).val( "Hide"); } }); </script> So, when I click the Hide/show button, it will perform the action for each button beneath the clicked button + once for the button itself. So If I click a button, and there are two buttons beneath it, and value=hide it will first hide the 'textarea', than show the text area, than finally hide it again. I'm new to jQuery (although I do have experience in other languages), and I have an -idea- why it's not working: that whenever an action is performed jQuery jumps to the first one, than continues down the page looking for any other actions performed, and responds to each one. So it comes to my first button, sets it as being clicked, and so when jQuery comes across the other buttons it views them all as being 'clicked' and performs actions accordingly. I've thought of a semi-solution to my problem, putting in a variable which tracks how many times it has gone through, and than acting based on -that- action. But I would rather not do that, since it's not really a solution to the problem at hand but a work around. Any input is appreciated.

    Read the article

  • How to create Hash object/array using jquery?

    - by Patrick
    Hi folks I know there is a Hash() object in the Javascript prototype framework, but is there anything in Jquery like this? As I would like to stick with one javascript framework, rather than mixing the Prototype Frame work and the JQuery framework and use at the same time, as I worry there will be conflict and create side-effects. So my question is: how to create Hash object/array using jquery? Here is my function: /* prototype framework, I want to change this to jQuery! */ var starSaves = new Hash(); function myHover(id, pos) { var starStrip = $('star_strip_' + id); if (starSaves.keys().indexOf(id) == -1) { var starSave = new Array(); var imgs = starStrip.select("img") alert(imgs); for (var i = 0; i < imgs.length; i++) { starSave[starSave.length] = imgs[i].src; if (i < pos) imgs[i].src = "/images/star_1.gif"; else imgs[i].src = "/images/star_0.gif"; } starSaves.set(id, starSave); } }

    Read the article

  • How can I design a custom control in Javascript (possibly using jQuery)

    - by Mathieu Pagé
    I'd like to create a custom control in javascript. The goal is to create a building block that has methods, properties and events and render into a div. An example of one such control would be a calendar. It would render into a div, it would have properties that would define how it's displayed and what date is selected or highlighted, it would have methods to change the current month or to select some date and it would raise events when a day is clicked or the current month is changed by a user input. I can think of lots of way to implement this and I'm not sure what is the best way. I seem to remember that it's a bad thing to augment a DOM elements with properties and method, so I ruled that out. A jQuery plugin seems like a good idea, however I'm not sure if it's appropriate to create a plugin for each and every method my control would have so I could then use it like : $('#control').method1(); $('#control').method2(); And if I do use jQuery, where do I store the private data of my control? Another idea I got was to create a new kind of object that would have a reference to a div in which it could render it's elements. So what is the prefered way to do this. If I can I would like to do this as a jQuery plugin, but I'd need guidlines on how to create methods and where to store private data. I've loked at Plugins/Authoring on jQuery website and it did not helped that much in this regard.

    Read the article

  • Can JQuery.Validate plugin prevent submission of an Ajax form

    - by berko
    I am using the JQuery form plugin (http://malsup.com/jquery/form/) to handle the ajax submission of a form. I also have JQuery.Validate (http://docs.jquery.com/Plugins/Validation) plugged in for my client side validation. What I am seeing is that the validation fails when I expect it to however it does not stop the form from submitting. When I was using a traditional form (i.e. non-ajax) the validation failing prevented the form for submitting at all.... which is my desired behaviour. I know that the validation is hooked up correctly as the validation messages still appear after the ajax submit has happened. So what I am I missing that is preventing my desired behaviour? Sample code below.... <form id="searchForm" method="post" action="/User/GetDetails"> <input id="username" name="username" type="text" value="user.name" /> <input id="submit" name="submit" type="submit" value="Search" /> </form> <div id="detailsView"> </div> <script type="text/javascript"> var options = { target: '#detailsView' }; $('#searchForm').ajaxForm(options); $('#searchForm').validate({ rules: { username: {required:true}}, messages: { username: {required:"Username is a required field."}} }); </script>

    Read the article

  • IIS6 throws error for jquery.

    - by user309557
    Hi, on my master page, I have referenced jquery file. I am doing simple hover function. When mouse hover, I change the css and when hover out, change the css back to originial. Nothing fancy. but my page throws jquery error when I run in IIS6 on server 2003. When I run on IIS5.1 on local xp machine, it works perfectly fine. Any idea? I access both pages from my machine so IE settings is not the problem. I opened the both js file and the error line is nothing but the end of the file ( i.e last line of the js file) Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; OfficeLiveConnector.1.4; OfficeLivePatch.1.3) Timestamp: Mon, 5 Apr 2010 21:59:18 UTC Message: Syntax error Line: 4377 Char: 2 Code: 0 URI: server-test/myapplication/Scripts/jquery-1.3.2.js (removed the link because stackoverflow does not allow me to put more than one link) Message: Syntax error Line: 6183 Char: 2 Code: 0 URI: server-test/myapplication/Scripts/jquery-1.3.2-vsdoc.js (removed the link because stackoverflow does not allow me to put more than one link) Message: Object expected Line: 189 Char: 9 Code: 0 URI: http://server-test/myapplication/

    Read the article

  • How do I use jQuery in my Greasemonkey Javascript scripts?

    - by tladuke
    I saw a question here and many blog posts about getting jquery into greasemonkey, but I can't get anything to work. Here's my script: // ==UserScript== // @name Hello jQuery // @namespace http://foo.bar // @description jQuery test script // @include * // ==/UserScript== #{contents of jquery.latest.js pasted in} unsafeWindow.jQuery = jQuery; $(document).ready(function() { alert('Hello world!'); }); I'm hoping to see an alert when I refresh a page, so I can start actually programming something. I've tried a bunch of other things and so far nothing works. The script is enabled in the little monkey menu... edit: the script part now looks like this: foo(); function foo() { $ = unsafeWindow.jQuery; $('tr td.row2:nth-child(4)').css("background-color", "#999"); } it doesn't work. I know the jQuery is good because I can run it from outside of greasemonkey. If instead of a jQuery function is just say alert('hello'); that works fine; I get the alert on page-load.

    Read the article

  • jquery an div tags used in a ordered list

    - by shan2on
    hello everyone, i'm not sure where my errors are lying but here is my scenario... i have an un-ordered list in html that handles my main link bar... <ul id="navlist"> <li><a href="/" id="current">home</a></li> <li><a href="#" id="search">search</a></li> <li><a href="#" id="users">login</a></li> </ul> and what i want done is to call each id and have jQuery handle each and dislpay it where specified in my css file... for now, lets just ignore my "home" link... here is a snippet of my inline jquery $(document).ready(function() { $("a").click(function () { $("div#login").slideToggle("fast"); }); }) Now, whichever div i specify, it calls that ... however it will only call one div, using either from the un-orderd list, as mentioned above in the html. My Goal is to call a search bar when search is clicked, and to call a login box when login is clicked. to my knowledge (noob), i believe use an as a class, however that is what brings me here. i believe my error is in my jquery and not my css, as stated above, either instance will be displayed when the jquery function calls either tag. any help is greatly appreciated. thanks in advance shan2on

    Read the article

  • Problem with mathamatical calculation in JQUERY

    - by Param-Ganak
    Hello friends! I have two text boxes. I enter number in one textbox. I write following JQUERY for that textbox which get executed when the focus out from first text box. The JQUERY code takes the entered value from first text box and multiply it by a decimal number 34.95 and display the answer in second text box. The code is doing the calculation little bit ok because when I enter the value 1000 in first text box it gives answer 34950 in second textbox and when I enter the value 100 in first text box it gives answer 3495.0000000000005 in second text box. **Please any one tell me what is the problem. is problem is in my JQUERY code. I also want to show the answer always in decimal point. Answer should always dislply only two digits after decimal point. so How to achieve this too.** This is my JQUERY code. $("#id_pvalue").focusout(function() { q=$("#id_pvalue").val(); var ans=q*34.95; $("#id_tvalue").val(ans); }); Please guide me friends! Thank You!

    Read the article

  • jQuery: responding to click event of element added to document after page load

    - by morpheous
    I am writing a page which uses a lot of in situ editing and updating using jQuery for AJAX. I have come accross a problem which can best be summarised by the workflow described below: Clicking on 'element1' on the page results in a jQuery AJAX POST Data is received in json format The data received in json format The received data is used to update an existing element 'results' in the page The received data is actual an HTML form I want jQuery to be responsible for POSTing the form when the form button is clicked The problem arises at point 6 above. I have code in my main page which looks like this: $(document).ready(function(){ $('img#inserted_form_btn').click(function(){ $.ajax({'type: 'POST', 'url': 'www.example.com', function($data){ $(data.id).html($data.frm); }), 'dataType': 'json'} }); }); However, the event is not being triggered. I think this is because when the document is first loaded, the img#inserted_form_btn element does not exist on the page (it is inserted into the DOM as the result of an element being clicked on the page (not shown in the code above - to keep the question short) My question therefore is: how can I get jQuery to be able to respond to events occuring in elements that were added to the DOM AFTER the page has loaded?

    Read the article

  • jquery tabs - load url in current tab?

    - by BigDogsBarking
    I'm trying to figure out how to load the url each tab links to inside the tab area onclick, and have been trying to following the docs at http://docs.jquery.com/UI/Tabs#...open_links_in_the_current_tab_instead_of_leaving_the_page, but am clearly not getting it.... This is the HTML markup: <div class="tabs"> <ul class="tabNav"> <li><a href="/1.html#tabone">Tab One</a></li> <li><a href="/2.html#tabtwo">Tab Two</a></li> <li><a href="/3.html#tabthree">Tab Three</a></li> </ul> </div> <div id="tabone"> <!-- Trying to load content from 1.html in this div on click --> </div> <div id="tabtwo"> <!-- Trying to load content from 2.html in this div on click --> </div> <div id="tabthree"> <!-- Trying to load content from 3.html in this div on click --> </div> And this is the jquery I'm trying to use: $(".tabs").tabs({ load: function(event, ui) { $('a', ui.panel).click(function() { $(ui.panel).load(this.href); return false; }); } }); I know I've got some part of this wrong.... I've gone through several iterations (too many to post), and all I get is a blank div... I don't know... Feeling a bit confused here... Help?

    Read the article

  • Getting Response From Jquery JSON

    - by Howdy_McGee
    I'm having trouble getting a response from my php jquery / json / ajax. I keep combining all these different tutorials together but I still can't seem to pull it all together since no one tutorial follow what I'm trying to do. Right now I'm trying to pass two arrays (since there's no easy way to pass associative arrays) to my jquery ajax function and just alert it out. Here's my code: PHP $names = array('john doe', 'jane doe'); $ids = array('123', '223'); $data['names'] = $names; $data['ids'] = $ids; echo json_encode($data); Jquery function getList(){ $.ajax({ type: "GET", url: 'test.php', data: "", complete: function(data){ var test = jQuery.parseJSON(data); alert(test.names[0]); alert("here"); } }, "json"); } getList(); In my html file all I'm really calling is my javascript file for debugging purposes. I know i'm returning an object but I'm getting an error with null values in my names section, and i'm not sure why. What am I missing? My PHP file returns {"names":["john doe","jane doe"],"ids":["123","223"]} It seems to be just ending here Uncaught TypeError: Cannot read property '0' of undefined so my sub0 is killing me.

    Read the article

  • jquery simplemodal close wont work in firefox

    - by junkqwe
    I am using jquery.simplemodal 1.3.5 (i tried older versions) the close button doesnt close the modal in firefox (i tried IE and it work fine) this is the test page i am using: <html> <head> <title>Untitled Page</title> <style> #simplemodal-overlay { background-color:#000; cursor:wait; } #simplemodal-container a.modalCloseImg { background: url(../images/modal_close.png) no-repeat; width:25px; height:29px; display:inline; z-index:3200; position:absolute; top:15px; right:18px; cursor:pointer; } .modala { width: 372px; height: 206px; background: url(../images/modal.png) no-repeat; } </style> </head> <body> test page <script language="javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script> <script language="javascript" src="/include/jquery.simplemodal-1.3.5.js" type="text/javascript"></script> <script type="text/javascript"> $("body").click(function() { $.modal("<div class=\"modala\"><h1>SimpleModal</h1></div>", {overlayClose: true} ); }); </script> </body> </html> what can be the problem? is it a known problem with simplemodal and FF?

    Read the article

  • jQuery class selector and click()

    - by Anonymous
    I'm currently trying to get an alert to happen when something is clicked. I can get it working in jsFiddle, but not in production code: jsFiddle example that works (jQuery 1.5 loaded) HTML (in case jsFiddle is inaccessible): <!DOCTYPE HTML><html><head><title>Test</title></head> <body> <h1>25 Feb 2011</h1><h3>ABC</h3><ul> <li class="todoitem">Test&mdash;5 minutes</li> </ul> </body></html> Javascript: $(".todoitem").click(function() { alert('Item selected'); }); Non-working production example: <!DOCTYPE HTML><html><head><title>Test</title> <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.1.min.js" type="text/javascript"></script> <script type="text/javascript"> $(".todoitem").click(function() { alert('Item selected'); }); </script> </head> <body> <h1>25 Feb 2011</h1><h3>ABC</h3><ul><li class="todoitem">Test&mdash;5 minutes</li></ul> </body> </html> Safari's Inspector indicate that jQuery is being loaded correctly, so that's not the issue. As far as I can tell, these two pieces of code are essentially identical, but the latter isn't working. Can anyone see what I've done wrong?

    Read the article

  • choose javascript variable based on element id from jquery

    - by phoffer
    I feel like this is a simple question, but I am still relatively new to javascript and jquery. I am developing a site for a touch interface that uses unordered lists and jquery .click functions to take input data. I have a section to input a m:ss time, with 3 divs, each containing a list of digits for time. I need to get the input for each column and set it as a variable. I originally designed the inputs to change form inputs, because I didn't understand javascript very much. It was easy to change the 3 hidden inputs by using div id's, but I can't figure out how to do it now with javascript variables. Here is my original jquery code... $("div#time>div>ul>li").click(function() { var id = $(this).parents(".time").attr("name"); var number = $(this).html(); $("input#"+id).val(number); }); The last line sets one of 3 hidden inputs equal to whatever was clicked. I need to make it so separate variables take the inputs, then I can manipulate those variables however I want. Here's a short snippet of the html, to have an idea of how jquery grabs it. <div id="time"> <h1>Time</h1> <div name="minute" class="time" id="t_minute"> M : <ul> The full time html is here: link text Thanks everyone! I've been using SO to answer many questions I've had, but I couldn't find something for this, so I figured I would join, since I'm sure I will have more questions along the way.

    Read the article

  • Jquery - Dialogue not displaying correctly on IE6

    - by ryeguy
    I am trying to use bgiform but it seems to have no effect. The text in IE is pushed off of the screen of the dialogue box when its displayed. It works fine in FF. Any ideas? <!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=utf-8" /> <title>Zoleris</title> <link href="style.css" rel="stylesheet" type="text/css" /> <link href="jquery-ui-themeroller/theme/ui.theme.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="jquery-1.3.1.js"></script> <script type="text/javascript" src="bgiframe_2.1.1/jquery.bgiframe.js"></script> <script type="text/javascript" src="jquery-ui-personalized-1.5.3.js"></script> <script type="text/javascript"> $(document).ready( function() { $("#block").dialog({ bgiframe: true}); } ); </script> <style> #block { width: 150px; height: 70px; margin: 10px; } </style> </head> <body> <div id="block" title="title">blah</div> </body> </html>

    Read the article

  • Shadowbox + jQuery not working - No errors.

    - by Shelton
    First, apologies. I'm a js newb. I'm attempting to trigger a shadowbox with the load of a specific page - a "pop-up" if you will. Nothing happens and according to firebug, there are no errors to report. I should note that this is wordpress, so I'm using the default jQuery call and also shadowbox rolled into a WP plug-in. Shadowbox does work properly in other areas of the site, as do jQuery functions. noConflict() is used because WP also loads prototype by default, which conflicts with the jQuery dollar sign. var $j = jQuery.noConflict(); $j(function(){ //Set cookie $j.cookie('padpop_viewed',true); // open a welcome message as soon as the window loads $j(function() { Shadowbox.open({ content: '<div width="600" height="460" style="margin:auto;"><a href="<?php bloginfo('url');?>"/products/"><img src="<?php bloginfo('template_url');?>/images/ipad-pop.jpg" width="600" height="460" alt="Redacted"/></a></div>', player: "html", height: "470", width: "610" }); }); }); Any help here would be greatly appreciated as I have spent hours consulting the documentation of each aspect of this. Thanks, S.

    Read the article

  • JQuery/AJAX: Loading external DIVs using dynamic content

    - by ticallian
    I need to create a page that will load divs from an external page using Jquery and AJAX. I have come across a few good tutorials, but they are all based on static content, my links and content are generated by PHP. The main tutorial I am basing my code on is from: http://yensdesign.com/2008/12/how-to-load-content-via-ajax-in-jquery/ The exact function i need is as follows: Main page contains a permanent div listing some links containing a parameter. Upon click, link passes parameter to external page. External page filters recordset against parameter and populates div with results. The new div contains a new set of links with new parameters. The external div is loaded underneath the main pages first div. Process can then be repeated creating a chain of divs under each other. The last div in the chain will then direct to a new page collating all the previously used querystrings. I can handle all of the PHP work with populating the divs on the main and external pages. It's the JQuery and AJAX part i'm struggling with. $(document).ready(function(){ var sections = $('a[id^=link_]'); // Link that passes parameter to external page var content = $('div[id^=content_]'); // Where external div is loaded to sections.click(function(){ //load selected section switch(this.id){ case "div01": content.load("external.php?param=1 #section_div01"); break; case "div02": content.load("external.php?param=2 #section_div02"); break; } }); The problem I am having is getting JQuery to pass the dynamically generated parameters to the external page and then retrieve the new div. I can currently only do this with static links (As above).

    Read the article

  • Load function in jquery

    - by user345579
    Hi, I am relatively new to jquery and would like to know why the below code wouldn't work. I am trying to access the content from a file residing on my site and not outside. Is it because I have the jquery lib loading from google and not my site? The error message that I get in IE browser is "Access Denied". I am confused why the access is denied if I am trying to load a file from the same server and even same folder. <html> <head> <script type="text/javascript" language="JavaScript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript" language="JavaScript"> $(document).ready(function(){ $("#response").load("http://www.mydomain.com/loadme.php?route=links/getlinks&path=2"); }); </script> </head> <body> <div id="response" style="border: 1px solid #000;height:500px;">&nbsp;</div> </body> </html> any one please help me. thanks

    Read the article

  • jquery, attaching objects (instead of string attribute) to an element

    - by binaryLV
    Hi! I'm trying to build DOM with jQuery and fill it with data that is received with AJAX (data type = json). I'd like to also store this data as an object, attached to a specific DOM element. Does jQuery provide any method for this? The reason I want to do it is because only part of data is initially displayed; other data might be needed later, depending on user actions. I tried using attr(), but it stores a string "[object Object]" instead of an actual object: var div = $('<div/>'); div.attr('foo', {bar: 'foobar'}); alert(div.attr('foo')); // gives "[object Object]" alert(typeof div.attr('foo')); // gives "string" alert(div.attr('foo').bar); // gives "undefined" Another way to do this would be by "bypassing" jQuery (div[0].foo = {bar: 'foobar'};), though this seems to be a "dirty workaround", if jQuery happens to already support attaching objects. Any ideas? Thanks in advance!

    Read the article

  • jScrollPane jEditable DOM problems

    - by Kyle Lafkoff
    Hello world, I am having a funky problem. See (this link won't disappear): www.skitzo.org/~el/bugjeditable.png for the firebug output screenshot. Here's my code. I run getJSON() to fetch the info from the PHP which pulls from DB and I fill a div with the result. I have jScrollPane and jEditable so a user can scroll down and click to edit any of the content. It works sometimes and then it doesn't work which makes me wonder if the browser is not interpreting the code properly or if I am misunderstanding fundamental DOM concepts here.... Here is a live current version of the code: http://www.musedates.com/testing.php $().ready(function() { $('#pane1').jScrollPane(); $('#tab_journal').tabs(); $('#tab2').load("/journal_new.php"); var i=0; var row = ''; var k, v, dt; $.getJSON("/ajax.php?j=22", function(data) { row = '<p>'; while(i<data.length) { $.each(data[i], function(k, v) { if (k == 'subject') { row += '<div style="font-size:1.5em; color:#000000;"><div class="editable" style="width:705px;" id="title-'+data[i].id+'">'+v+'</div></div>posted: '+dt+'<br />'; } else if (k == 'dt') { dt = v; } else if (k == 'msg') { row += '<div class="editableMsg" style="width:705px; height:40px;" id="msg-'+data[i].id+'">'+v+'</div></p>'; } }); i++; } $('#pane1').append(row).jScrollPane({scrollbarWidth:10, scrollbarMargin:10, showArrows:true}); }); $('.editable').livequery(function () { $('.editable').editable("/savejournal.php", { submitdata : function() { }, tooltip : 'Click to edit', indicator : '<img src="/UI/images/indicator.gif">', cancel : 'Cancel', submit : 'OK' }); $('.editableMsg').editable("/savejournal.php", { submitdata : function() { }, tooltip: 'Click to edit', indicator : '<img src="/UI/images/indicator.gif">', cancel : 'Cancel', submit : 'OK', type : 'textarea' }); $(".editable,.editableMsg").mouseover(function() { $(this).css('background-color', '#FDD017'); }); $(".editable,.editableMsg").mouseout(function() { $(this).css('background-color', '#fff'); }); }); }); And then the HTML: <div id="tab_container" style="margin:0px 0px 2px 8px;"> <ul id="tab_journal"> <li><a href="#tab1"><span>View / Edit</span></a></li> <li><a href="#tab2"><span>New Entry</span></a></li> </ul> </div> <div id="tab1" style="margin:0px 0px 0px 8px;"> <div id="pane1" class="scroll-pane super-wide"></div> </div> <div id="tab2" style="margin:0px 0px 0px 8px; width:700px;"></div> Thanks world.

    Read the article

< Previous Page | 110 111 112 113 114 115 116 117 118 119 120 121  | Next Page >