Search Results

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

Page 71/935 | < Previous Page | 67 68 69 70 71 72 73 74 75 76 77 78  | Next Page >

  • jquery ajax call: multiple links load data into one div

    - by user1146939
    I have a dynamically generated list of links. Each link will request a different page to load. Depending on the link clicked I want it to fill the div with an ajax .load call. The thing is I want all links to reset and fill the same div. I am having trouble doing this without making a seperate div for each link, which isn't what I'm looking for. This is what I have so far, but only works with one link. <a data-toggle="modal" href="#myModal">Link</a> <div class="modal hide fade" id="myModal"></div> <script type="text/javascript"> $(document).ready(function() { $('#myModal').load('mypage.php'); }); </script>

    Read the article

  • Jquery .load and inner jquery .append

    - by speekeazy
    Hello, Ive just started using jquery for the .load ajax functionality. When i load an external page to a specific div it loads fine. inside the external page there is an .append that .appends javascript to the head. This works on the initial load but when i use .load to load it this portion is not showing. //This is the .load for the div function loadContent(elementSelector, sourceUrl) { url = ""+sourceUrl+""; $(""+elementSelector+"").load(url); alert(url); } //This is the append in the other page that is embedded in a js var cUrl = "http://intensedebate.com/js/genericCommentWrapper2.php?acct="+idcomments_acct+"&postid="+idcomments_post_id+"&title="+idcomments_post_title+"&url="+idcomments_post_url; alert(cUrl); commentScript.type = "text/javascript"; commentScript.src = cUrl; $('head').append(commentScript);

    Read the article

  • Add a custom jquery validation method not connected to a field

    - by Johan Wikström
    Normally all validation methods is connected to a field, radiobuttons, dropdowns etc. In my case I would like to do a general custom validation that depends on many fields in my form. I dont want one field of them to become highlighted like a normal "required", i would rather just show a message in the errorcontainer. Is there a simple way to do this I have overlooked?

    Read the article

  • stored context in a JQuery variable does not work

    - by user203687
    The following works fine: $(function() { EnableDisableButtons(); $('#TextBox1').keyup(function() { EnableDisableButtons(); }); }); function EnableDisableButtons() { var len = $('#TextBox1').val().length; if (len == 0) { $("#Button1").attr("disabled", "disabled"); } else { $("#Button1").attr("disabled", ""); } } But the following does not work at all: var txt = $('#TextBox1'); $(function() { EnableDisableButtons(); txt.keyup(function() { EnableDisableButtons(); }); }); function EnableDisableButtons() { var len = txt.val().length; if (len == 0) { $("#Button1").attr("disabled", "disabled"); } else { $("#Button1").attr("disabled", ""); } } The error it was throwing was " 'txt.val().length' is null or not an object". Can anyone help me on this. thanks

    Read the article

  • Jquery mobile and PhoneGap: Reload page to get next item in database

    - by Amy Sukumunu
    I want to reload the page after the user swipe right to the next item in database (id will increment 1) but it is not functioning. It show the alert (ID+1) but the page still does not reload or changePage(same page) to get the new item. $('#word').live( 'swipeleft', function( e ) { alert( 'You swiped right!' ); if(parseInt(sessionStorage.currWord_ID) >= parseInt(sessionStorage.firstWordID) && parseInt(sessionStorage.currWord_ID) < parseInt(sessionStorage.lastWordID)){ sessionStorage.currWord_ID = parseInt(sessionStorage.currWord_ID) + 1; alert("ID +1"); $.mobile.changePage($("#word"),{transition: "pop",reloadPage: true}); } } );

    Read the article

  • jQuery accordion: is there a way to make the scrollbar fit the displayed panel?

    - by Cheeso
    I have a jQuery accordion (jQuery 1.3.2, jQuery UI 1.7.2), with between 3-12 content panels. Some of the content panels are large, and have lots of content. some are small, and have only a little. When I expand any of them, the scrollbar on the div containing the accordion (it's got css overflow: auto;) is set as if the largest of the panels is expanded. Let's say I have 3 panels. One has 3 lines of content, one has 20 lines, and one has 1000 lines. If I expand either of the first two, the scrollbar indicator gets very very tiny, and moves all the way to the top, even though there is nothing worth scrolling. Is there a way to fix this? It seems like autoHeight:false ought to do it, but that doesn't work for me.

    Read the article

  • Check Avaibility of a page before loading using jquery/ajax

    - by overcomer
    Is it possible check the Accessibility of a page before loading it? I have a form, running on mobile device using wireless connection. The problem is: not always this connection is avaible and i would like to alert the user when is doing a submit or an unload of the page. The problem is that the page contains elements doing redirect like this: <input type="button" value="MyText" onClick="script1;script2;...window.location='mylocation" /> If the user click on this button and the server is not achievable, i will recive some undesiderable errors. Also if I want to generalize my script i do not know the value of "mylocation" previously. The page contains elements to submit the Form also: <input type="submit" name="SUBMIT" value="MyValue" onClick="return eval('validationForm()')" /> For the submitting I'm using the ajaxForm plugin and it works quite well. This is a snippet of code: Thanks to your answer I found the solution to the problem. That's the code: function checkConnection(u,s){ $.ajax({ url:u, cache:false, timeout:3000, error: function(jqXHR, textStatus) { alert("Request failed: " + textStatus ); }, success: function() { eval(s); } }); } $(document).ready(function() { // part of the function that checks buttons with redirect // for any input that contain a redirect on onClick attribute ("window.locarion=") $("input[type=button]").each(function(){ var script = $(this).attr("onClick"); var url = ""; var position = script.indexOf("window.location") ; if (position >= 0) { // case of redirect url = script.substring(position+17, script.lenght); url = url.split("\'")[0]; url = "\'"+url+"\'"; // that's my url script = "\""+script+"\""; // that's the complete script $(this).attr("onClick","checkConnection("+url+","+script+")"); } }); // part of the function that checks the submit buttons (using ajaxForm plugin) var is_error = false; var options = { error: function() { if (alert("Error Message")==true) { } is_error = true; }, target: window.document, replaceTarget: is_error, timeout: 3000 }; $("#myForm").ajaxForm(options); }); I hope that this will be usefull.

    Read the article

  • Jquery mobile function calls before Ajax Request end

    - by rpmlins
    Here is my problem. When My Home page shows, I call the LoadUser functions, which on success, sets the globalUser variable with the returned json, and after it loads I call the alert function but it says globalUser is undefined. I have tried many other work arounds, but I always get the undefined mesage. If I call the alert(globalUser); on the success function, it works as expected alerting the object. $('#Home').live('pageshow', function(event) { $.when(LoadUser()).done(function(a1) { alert(globalUser); }); }); function LoadUser() { $.ajax({ // connects with the web service and validate de user input url: "http://localhost:51396/Icademy.asmx/GetUser", contentType: "application/json; charset=utf-8", data: { "userName": "'rodrigo'" }, dataType: "jsonp", success: function(json) { globalUser = JSON.parse(json.d); return globalUser; }, error: function(ret) { alert("Um erro ocorreu, tente novamente mais tarde."); } }); }

    Read the article

  • jquery selector for td in a table

    - by ooo
    i want to get a event that will fire when i click inside a td of a html table i had this: ('td').live('click', function() { alert($(this).attr('id')); }); which works but this fires inside the 'th" cells as well (not sure why). is there any selector that just fires inside td's and not th's. I tried this: ('tbody td').live('click', function() { alert($(this).attr('id')); }); but that didn't seems to stop this firing for the th's.

    Read the article

  • How to disable an input with jQuery Validation Plugin

    - by Eelke
    This should be really simple but I can't get it to work, how do I disable and add a class to an input? Let's say I've got an input field with id = name, this is how far I got, $("input#name").attr("disabled"); What am I doing wrong here? Any help would be greatly appreciated, thanks in advance!

    Read the article

  • $.post() in jQuery not working as expected

    - by Bunny Rabbit
    $('a').click(function(event){ $('body').html('loading...'); $.post('www.sitename.com/hello',{site:"http//:www.google.com"},function(data) { alert(data); }); event.preventDefault(); }); I am using the above script to override the default behaviour of the links .The site reffred here returns the html of the 'site' paraeter.but the page just stops after printing loading...

    Read the article

  • jquery UI slider not working in Safari.

    - by Joe
    so i have the below code, which I think is fine: jQuery( function() { jQuery("#slider-vertical").slider( { orientation :"vertical", range :"min", min :0, max :100, value :50, slide : function(event, ui) { jQuery("#amount").val(ui.value); var movie = thisMovie('ClusterFlash'); fromScroll = jQuery("#amount").val(); if (movie) { currentSentiment = ((100 - fromScroll) / 100); movie.sentimentChange(currentSentiment); } } }); }); the 'movie' var above calls the following function, which seems to be where my problem is. function thisMovie(movieName) { if (navigator.appName.indexOf("Microsoft") != -1) { return window[movieName]; } if(document[movieName].length != undefined) { return document[movieName][1]; } return document[movieName]; } Any help would be appreciated. Thank

    Read the article

  • JQuery get height of each previous element

    - by Jk_
    I'm trying to find a good solution to get the height of all the element above my target. So loop the prev() function ! Any ideas on how I could deal with that ? <div> <div style="height:50px;width:100%"></div> <div style="height:12px;width:100%"></div> <div style="height:23px;width:100%"></div> <div style="height:56px;width:100%"></div> <div id="#mytarget"><p>HERE</p></div> </div> $('#mytarget').prev().each(function() { alert($(this).outerHeight()); }); and it will fires ["56","23","12","50"].

    Read the article

  • jQuery select last word after = (equal symbol)

    - by Jonathan
    I'm using $(this).attr("href"); to select the href attribute value of the clicked element, but I need to select only the part after the last '=' symbol. Example: href="index.php?con=123&id=123&sel=heyhey" I only need the last part of the href that is 'heyhey' How can I select this??

    Read the article

  • div content change only jquery Mobile

    - by user3659748
    I have that : <div data-role="page" id="Home"> <div data-role="header" > <h2 class="header">My app</h2> </div> <div data-role="content"> </div> <div data-role="footer" data-position="fixed"> <div data-role="navbar"> <ul> <li><a href="partials/home.html" data-icon="home" data-transition="slide">Home</a></li> <li><a href="partials/about.html" data-icon="info">About</a></li> </ul> </div> </div> </div> </body> I want when a users click on links le content slide on a div content of for exemple home.html who have just that : home that is possible or not ? Thanks :)

    Read the article

  • Jquery (this) selector help

    - by mtwallet
    Hi. I have the following HTML: <div class="box"><img src="pic.jpg" alt="image" /></div> <div class="box"><img src="pic.jpg" alt="image" /></div> <div class="box"><img src="pic.jpg" alt="image" /></div> <div class="box"><img src="pic.jpg" alt="image" /></div> I am trying to select the div and the child image both at the same time. I need to use $(this) to select the div. I know I can use $(this).children() or $(this).find('img') to get the image. Is there a way to select both the div and image using $(this) for the div.

    Read the article

  • jQuery variable iteration with .each()

    - by user1143357
    My code needs to capture the 'src' of an image in a variable. It then needs to insert this variable into a 'href' tag on a link which surrounds the image. My code is as follows: $('.fancybox-image-li img').each(function(test) { var test = $(this).attr("src"); $('.fancybox-image-link').attr('href', ''+test+''); }); Unfortunately what seems to be happening is the 'test' var is only getting the attribute of the last img and then inserting this into all the 'href' attributes. Any ideas how I can get the variable to change per image. Cheers!

    Read the article

  • Removing round corners from the button in jquery mobile

    - by user1435731
    I have following button markup in a single/multiple page jquerymobile page template. <a href="#" data-role="button" data-icon="arrow-r" data-iconpos="right" >About Us</a> I need to disable the round corners of this button using the button option as given in the jquerymobile docs. I have tried $('a').buttonMarkup({ corners: "false" }) in every events such as pagebeforecreate, pageinit, pagecreate and mobileinit I never got it working and have been struggling with it to make it for quite a long time. I dont want to use data attribute data-corners="false" for now. Please suggest any ideas

    Read the article

  • jQuery Treeview – Expand and Collapse All Without the TreeControl

    - by Ben Griswold
    The jQuery Treeview Plugin provides collapse all, expand all and toggle all support with very little effort on your part. Simply add a treecontrol with three links, and the treeview, to your page…   <div id="treecontrol">     <a title="Collapse the entire tree below" href="#"><img src="../images/minus.gif" /> Collapse All</a>     <a title="Expand the entire tree below" href="#"><img src="../images/plus.gif" /> Expand All</a>     <a title="Toggle the tree below, opening closed branches, closing open branches" href="#">Toggle All</a> </div> <ul id="treeview" class="treeview-black">     <li>Item 1</li>     <li>         <span>Item 2</span>         <ul>             <li>                 <span>Item 2.1</span>                   <ul>                     <li>Item 2.1.1</li>                     <li>Item 2.1.2</li>                 </ul>             </li>             <li>Item 2.2</li>             <li class="closed">                   <span>Item 2.3 (closed at start)</span>                 <ul>                     <li>Item 2.3.1</li>                     <li>Item 2.3.2</li>                 </ul>             </li>         </ul>     </li> </ul> …and then associate the control to the treeview when defining the treeview settings. $("#treeview").treeview({     control: "#treecontrol",     persist: "cookie",     cookieId: "treeview-black" }); It really couldn’t be easier and it works great! But the plugin doesn’t offer a lot of flexibility when it comes to layout.  For example, the plugin assumes your treecontrol will include links.  If you want buttons or images or whatever, you are out of luck.  The plugin also assumes a set number of links and the collapse all handler is associated with the first link inside of the treecontrol, a:eq(0), the expand all handler is associated with the second link and so on.  So you really can’t incorporate the toggle all link by itself unless you manually hide the other options. Which brings me to the point of this post – making the collapse/expand/toggle layout more flexible without modifying the plugin’s source code. We will continue to use the treecontrol actions but we’re not going to use them directly. In fact, our custom collapse, expand and toggle links will trigger the actions for us.  So, hide the treecontrol links and associate the treecontrol click events with the click events of other controls.  Finally, render the treeview with the same setting definitions as usual. $(document).ready(function() {     // The plugin shows the treecontrol after the     // collapse, expand and toggle events are hooked up     // Just hide the links.     $('#treecontrol a').hide();       // On click of your custom links, button, etc     // Trigger the appropriate treecontrol click     $('#expandAll').click(function() {                 $('#treecontrol a:eq(1)').click();         });          $('#collapseAll').click(function() {         $('#treecontrol a:eq(0)').click();             });       // Render the treeview per usual.         $("#treeview").treeview({         control: "#treecontrol",         persist: "cookie",         cookieId: "treeview-black"     }); }); Since I’m not using the treecontrol directly, I move it to the bottom of the page but it doesn’t really matter where the treecontrol goes. <div>     <a id="collapseAll" href="#">Collapse All Outside of TreeControl</a> </div>   <ul id="treeview" class="treeview-black">     <li>Item 1</li>     <li>         <span>Item 2</span>         <ul>             <li>                 <span>Item 2.1</span>                 <ul>                     <li>Item 2.1.1</li>                     <li>Item 2.1.2</li>                 </ul>             </li>             <li>Item 2.2</li>             <li class="closed">                 <span>Item 2.3 (closed at start)</span>                 <ul>                     <li>Item 2.3.1</li>                     <li>Item 2.3.2</li>                 </ul>             </li>         </ul>     </li> </ul>   <div>     <input type="button" id="expandAll" value="Expand All Outside of TreeControl"/> </div>   <div id="treecontrol">     <a href="#"></a><a href="#"></a><a href="#"></a> </div> The above jQuery and Html snippets generate the following ugly output which shows the separated collapse/expand elements. If you want the toggle all option, I bet you can figure out how to put it in place.  I’ve made the source available below if you’re interested. Download jQuery Treeview Expand and Collapse Super Code

    Read the article

  • You should NOT be writing jQuery in SharePoint if&hellip;

    - by Mark Rackley
    Yes… another one of these posts. What can I say? I’m a pot stirrer.. a rabble rouser *rabble rabble* jQuery in SharePoint seems to be a fairly polarizing issue with one side thinking it is the most awesome thing since Princess Leia as the slave girl in Return of the Jedi and the other half thinking it is the worst idea since Mannequin 2: On the Move. The correct answer is OF COURSE “it depends”. But what are those deciding factors that make jQuery an awesome fit or leave a bad taste in your mouth? Let’s see if I can drive the discussion here with some polarizing comments of my own… I know some of you are getting ready to leave your comments even now before reading the rest of the blog, which is great! Iron sharpens iron… These discussions hopefully open us up to understanding the entire process better and think about things in a different way. You should not be writing jQuery in SharePoint if you are not a developer… Let’s start off with my most polarizing and rant filled portion of the blog post. If you don’t know what you are doing or you don’t have a background that helps you understand the implications of what you are writing then you should not be writing jQuery in SharePoint! I truly believe that one of the biggest reasons for the jQuery haters is because of all the bad jQuery out there. If you don’t know what you are doing you can do some NASTY things! One of the best stories I’ve heard about this is from my good friend John Ferringer (@ferringer). John tells this story during our Mythbusters session we do together. One of his clients was undergoing a Denial of Service attack and they couldn’t figure out what was going on! After much searching they found that some genius jQuery developer wrote some code for an image rotator, but did not take into account what happens when there are no images to load! The code just kept hitting the servers over and over and over again which prevented anything else from getting done! Now, I’m NOT saying that I have not done the same sort of thing in the past or am immune from such mistakes. My point is that if you don’t know what you are doing, there are very REAL consequences that can have a major impact on your organization AND they will be hard to track down.  Think how happy your boss will be after you copy and pasted some jQuery from a blog without understanding what it does, it brings down the farm, AND it takes them 3 days to track it back to you.  :/ Good times will not be had. Like it or not JavaScript/jQuery is a programming language. While you .NET people sit on your high horses because your code is compiled and “runs faster” (also debatable), the rest of us will be actually getting work done and delivering solutions while you are trying to figure out why your widget won’t deploy. I can pick at that scab because I write .NET code too and speak from experience. I can do both, and do both well. So, I am not speaking from ignorance here. In JavaScript/jQuery you have variables, loops, conditionals, functions, arrays, events, and built in methods. If you are not a developer you just aren’t going to take advantage of all of that and use it correctly. Ahhh.. but there is hope! There is a lot of jQuery resources out there to help you learn and learn well! There are many experts on the subject that will gladly tell you when you are smoking crack. I just this minute saw a tweet from @cquick with a link to: “jQuery Fundamentals”. I just glanced through it and this may be a great primer for you aspiring jQuery devs. Take advantage of all the resources and become a developer! Hey, it will look awesome on your resume right? You should not be writing jQuery in SharePoint if it depends too much on client resources for a good user experience I’ve said it once and I’ll say it over and over until you understand. jQuery is executed on the client’s computer. Got it? If you are looping through hundreds of rows of data, searching through an enormous DOM, or performing many calculations it is going to take some time! AND if your user happens to be sitting on some old PC somewhere that they picked up at a garage sale their experience will be that much worse! If you can’t give the user a good experience they will not use the site. So, if jQuery is causing the user to have a bad experience, don’t use it. I sometimes go as far to say that you should NOT go to jQuery as a first option for external facing web sites because you have ZERO control over what the end user’s computer will be. You just can’t guarantee an awesome user experience all of the time. Ahhh… but you have no choice? (where have I heard that before?). Well… if you really have no choice, here are some tips to help improve the experience: Avoid screen scraping This is not 1999 and SharePoint is not an old green screen from a mainframe… so why are you treating it like it is? Screen scraping is time consuming and client intensive. Take advantage of tools like SPServices to do your data retrieval when possible. Fine tune your DOM searches A lot of time can be eaten up just searching the DOM and ignoring table rows that you don’t need. Write better jQuery to only loop through tables rows that you need, or only access specific elements you need. Take advantage of Element ID’s to return the one element you are looking for instead of looping through all the DOM over and over again. Write better jQuery Remember this is development. Think about how you can write cleaner, faster jQuery. This directly relates to the previous point of improving your DOM searches, but also when using arrays, variables and loops. Do you REALLY need to loop through that array 3 times? How can you knock it down to 2 times or even 1? When you have lots of calculations and data that you are manipulating every operation adds up. Think about how you can streamline it. Back in the old days before RAM was abundant, Cores were plentiful and dinosaurs roamed the earth, us developers had to take performance into account in everything we did. It’s a lost art that really needs to be used here. You should not be writing jQuery in SharePoint if you are sending a lot of data over the wire… Developer:  “Awesome… you can easily call SharePoint’s web services to retrieve and write data using SPServices!” Administrator: “Crap! you can easily call SharePoint’s web services to retrieve and write data using SPServices!” SPServices may indeed be the best thing that happened to SharePoint since the invention of SharePoint Saturdays by Godfather Lotter… BUT you HAVE to use it wisely! (I REFUSE to make the Spiderman reference). If you do not know what you are doing your code will bring back EVERY field and EVERY row from a list and push that over the internet with all that lovely XML wrapped around it. That can be a HUGE amount of data and will GREATLY impact performance! Calling several web service methods at the same time can cause the same problem and can negatively impact your SharePoint servers. These problems, thankfully, are not difficult to rectify if you are careful: Limit list data retrieved Use CAML to reduce the number of rows returned and limit the fields returned using ViewFields.  You should definitely be doing this regardless. If you aren’t I hope your admin thumps you upside the head. Batch large list updates You may or may not have noticed that if you try to do large updates (hundreds of rows) that the performance is either completely abysmal or it fails over half the time. You can greatly improve performance and avoid timeouts by breaking up your updates into several smaller updates. I don’t know if there is a magic number for best performance, it really depends on how much data you are sending back more than the number of rows. However, I have found that 200 rows generally works well.  Play around and find the right number for your situation. Delay Web Service calls when possible One of the cool things about jQuery and SPServices is that you can delay queries to the server until they are actually needed instead of doing them all at once. This can lead to performance improvements over DataViewWebParts and even .NET code in the right situations. So, don’t load the data until it’s needed. In some instances you may not need to retrieve the data at all, so why retrieve it ALL the time? You should not be writing jQuery in SharePoint if there is a better solution… jQuery is NOT the silver bullet in SharePoint, it is not the answer to every question, it is just another tool in the developers toolkit. I urge all developers to know what options exist out there and choose the right one! Sometimes it will be jQuery, sometimes it will be .NET,  sometimes it will be XSL, and sometimes it will be some other choice… So, when is there a better solution to jQuery? When you can’t get away from performance problems Sometimes jQuery will just give you horrible performance regardless of what you do because of unavoidable obstacles. In these situations you are going to have to figure out an alternative. Can I do it with a DVWP or do I have to crack open Visual Studio? When you need to do something that jQuery can’t do There are lots of things you can’t do in jQuery like elevate privileges, event handlers, workflows, or interact with back end systems that have no web service interface. It just can’t do everything. When it can be done faster and more efficiently another way Why are you spending time to write jQuery to do a DataViewWebPart that would take 5 minutes? Or why are you trying to implement complicated logic that would be simple to do in .NET? If your answer is that you don’t have the option, okay. BUT if you do have the option don’t reinvent the wheel! Take advantage of the other tools. The answer is not always jQuery… sorry… the kool-aid tastes good, but sweet tea is pretty awesome too. You should not be using jQuery in SharePoint if you are a moron… Let’s finish up the blog on a high note… Yes.. it’s true, I sometimes type things just to get a reaction… guess this section title might be a good example, but it feels good sometimes just to type the words that a lot of us think… So.. don’t be that guy! Another good buddy of mine that works for Microsoft told me. “I loved jQuery in SharePoint…. until I had to support it.”. He went on to explain that some user was making several web service calls on a page using jQuery and then was calling Microsoft and COMPLAINING because the page took so long to load… DUH! What do you expect to happen when you are pushing that much data over the wire and are making that many web service calls at once!! It’s one thing to write that kind of code and accept it’s just going to take a while, it’s COMPLETELY another issue to do that and then complain when it’s not lightning fast!  Someone’s gene pool needs some chlorine. So, I think this is a nice summary of the blog… DON’T be that guy… don’t be a moron. How can you stop yourself from being a moron? Ah.. glad you asked, here are some tips: Think Is jQuery the right solution to my problem? Is there a better approach? What are the implications and pitfalls of using jQuery in this situation? Search What are others doing? Does someone have a better solution? Is there a third party library that does the same thing I need? Plan Write good jQuery. Limit calculations and data sent over the wire and don’t reinvent the wheel when possible. Test Okay, it works well on your machine. Try it on others ESPECIALLY if this is for an external site. Test with empty data. Test with hundreds of rows of data. Test as many scenarios as possible. Monitor those server resources to see the impact there as well. Ask the experts As smart as you are, there are people smarter than you. Even the experts talk to each other to make sure they aren't doing something stupid. And for the MOST part they are pretty nice guys. Marc Anderson and Christophe Humbert are two guys who regularly keep me in line. Make sure you aren’t doing something stupid. Repeat So, when you think you have the best solution possible, repeat the steps above just to be safe.  Conclusion jQuery is an awesome tool and has come in handy on many occasions. I’m even teaching a 1/2 day SharePoint & jQuery workshop at the upcoming SPTechCon in Boston if you want to berate me in person. However, it’s only as awesome as the developer behind the keyboard. It IS development and has its pitfalls. Knowledge and experience are invaluable to giving the user the best experience possible.  Let’s face it, in the end, no matter our opinions, prejudices, or ego providing our clients, customers, and users with the best solution possible is what counts. Period… end of sentence…

    Read the article

  • How to pass a parameter to jQuery UI dialog event handler?

    - by bebraw
    I am currently trying to hook up jQuery UI dialog so that I may use it to create new items to my page and to modify ones existing already on the page. I managed in the former. I'm currently struggling in the latter problem, however. I just cannot find a nice way to pass the item to modify to the dialog. Here's some code to illustrate the issue better. Note especially the part marked with XXX. The {{}} parts are derived from Django template syntax: $(".exercise").click(function() { $.post("{{ request.path }}", { action: "create_dialog", exercise_name: $(this).text() }, function(data) { $("#modify_exercise").html(data.content); }, "json" ); $("#modify_exercise").dialog('open'); }); $("#modify_exercise").dialog({ autoOpen: false, resizable: false, modal: true, buttons: { '{% trans 'Modify' %}': function() { var $inputs = $('#modify_exercise :input'); var post_values = {}; $inputs.each(function() { post_values[this.name] = $(this).val(); }); post_values.action = 'validate_form'; //XXX: how to get the exercise name here? post_values.exercise_name = 'foobar'; $.post('{{ request.path }}', post_values, function(data) { if( data.status == 'invalid' ) { $('#modify_exercise').html(data.content); } else { location.reload(); } }, "json" ); } } }); Here's some markup to show how the code relates to the structure: <div id="modify_exercise" class="dialog" title="{% trans 'Modify exercise' %}"> </div> <ul> {% for exercise in exercises %} <li> <a class="exercise" href="#" title="{{ exercise.description }}"> {{ exercise.name }} </a> </li> {% endfor %} </ul>

    Read the article

  • Why is jQuery so widely adopted versus other Javascript frameworks?

    - by Andrew Moore
    I manage a group of programmers. I do value my employees opinion but lately we've been divided as to which framework to use on web projects. I personally favor MooTools, but some of my team seems to want to migrate to jQuery because it is more widely adopted. That by itself is not enough for me to allow a migration. I have used both jQuery and MooTools. This particular essay tends to reflect how I feel about both frameworks. jQuery is great for DOM Manipulation, but seem to be limited to helping you do that. Feature wise, both jQuery and MooTools allow for easy DOM Selection and Manipulation: // jQuery $('#someContainer div[class~=dialog]') .css('border', '2px solid red') .addClass('critical'); // MooTools $('#someContainer div[class~=dialog]') .setStyle('border', '2px solid red') .addClass('critical'); Both jQuery and MooTools allow for easy AJAX: // jQuery $('#someContainer div[class~=dialog]') .load('/DialogContent.html'); // MooTools (Using shorthand notation, you can also use Request.HTML) $('#someContainer div[class~=dialog]') .load('/DialogContent.html'); Both jQuery and MooTools allow for easy DOM Animation: // jQuery $('#someContainer div[class~=dialog]') .animate({opacity: 1}, 500); // MooTools (Using shorthand notation, you can also use Fx.Tween). $('#someContainer div[class~=dialog]') .set('tween', {duration: 500}) .tween('opacity', 1); jQuery offers the following extras: Large community of supporters Plugin Repository Integration with Microsoft's ASP.NET and VisualStudio Used by Microsoft, Google and others MooTools offers the following extras: Object Oriented Framework with Classic OOP emulation for JS Extended native objects Higher consistency between browsers for native functions support. More easy code reuse Used by The World Wide Web Consortium, Palm and others. Given that, it seems that MooTools does everything jQuery does and more (some things I cannot do in jQuery and I can in MooTools) but jQuery has a smaller learning curve. So the question is, why did you or your team choose jQuery over another JavaScript framework? Note: While I know and admit jQuery is a great framework, there are other options around and I'm trying to take a decision as to why jQuery should be our choice versus what we use right now (MooTools)?

    Read the article

  • jQuery UI Question. How to pass parameters to a function.

    - by jiji40
    I am pretty new to jQuery. How do I pass parameters to a function? I found some jQueryUI demos and I got it working except "view" link. I have a problem with passing parameters to and show them in modal popup windows. I have "Create New User" button and "View" link on the page. Clicking "Create New User" does pass the parameters and show them on modal popup window. ('12345' in User ID textbox, 'John Starks' in User Name textbox) $(function() { ... //Create New User button $('#create-user') .button() .click( function() { $('#dialog-form').dialog('open'); userId.val('12345'); userName.val('John Starks'); } ); }); But, "View" link doesn't work... Clicking "View" link does pop up modal window with no value in the textbox(User ID and User Name) function doView( idP, nameP ) { $('#dialog-form2').dialog('open'); userId.val(idP); userName.val(nameP); } <a href="#" OnClick="doView('001','John Doe');" >view</a> ... How to pass the parameters to modal window? Thanks in advance.

    Read the article

  • jQuery - script tags in the HTML are parsed out by jQuery and not executed

    - by Jose Jose
    I have an HTML page like so: <html> <body> <div id='something'> ... <script> var x = 'hello world'; </script> ... </div> </body> </html> On another page, I am doing this: $.ajax({ url: 'example.html', type: 'GET', success: function(data) { $('#mydiv').html($(data).find('#something').html()); alert(x); } }); jQuery, however, is not executing the javascript in the first file, even though the documentation says it does. How can I make it do that? EDIT: Unfortunately in the real world application I am working on I don't have control over what the "included" page has. We are on the same domain, but I can't modify the code that it outputs as it is a packaged product our IT department will not let us modify.

    Read the article

< Previous Page | 67 68 69 70 71 72 73 74 75 76 77 78  | Next Page >