jquery

value of textarea : problem in firefox

I have written very simple script with jQuery, but the jquery code not working in firefox: <a href="" class="po">any text</a> <form> <input type="text" class="infobox"/> <br /> <textarea class="me"></textarea> <input type="submit" value="click" class="submit"/> </form> jQuery var vl = $('.po').text(); $('.po').clic...

jQuery ScrollTo: Multiple clicks on link = funky movement stacking

Here is the code: $('.next').click(function(){ $(window).stop(true,true).scrollTo('+=800px', 1000, { axis:'x' } ); }); $('.prev').click(function(){ $(window).stop(true,true).scrollTo('-=800px', 1000, { axis:'x' } ); }); Site can be previewed here: http://www.allisonnavon.com/index.php?/projects/raw-rhythm/ When the ...

jquery accordion performance

Does anyone know how many elements a jQuery accordion can handle before performance becomes a problem? I have a nested accordion structure with ten items at the root level, and then a handful of nested items within each root item down to a nesting level of three or four. Performance is unusable. It isn't great even with two levels. A...

jquery increment id and name of children within appended rows

Hey all. I am adding a "More Rows" button to a table within a long, complex form, and to add the rows, I am cloning an existing row in the table, modifying it, then appending it to the end of the table. The row contains inputs that have id and name attributes that are numbered sequentially (e.g. id="Item_Name1" and name="Item_Name1" fo...

Controlling one page with another using jQuery.

Using two separate browsers or computers, or for the sake of experimentation, two tabs, is there any way to push a command from one page to another that has some sort of listener object? So for example: controller.html has a link, when clicked triggers an action on viewer.html. Is this possible? ...

JavaScript performance - .test() vs .search()

If I need to see if a certain value is in a string, is it better for performance to use the .test() method or the .search() method? Example with .search(): var myRegExp = '/Orange/', myString = 'This is a string with the word "Orange."'; if(myString.search(myRegExp) != -1) { // Do code here } Example with .test(): var myReg...

Jquery - Should I not repeat selectors (store in a variable)?

There are some times when I find myself repeating a selector several times. Should I be somehow storing a jquery object to a variable and then just using that one? As a quick example, what about the following?: $('a.contactus).css('padding', '10px'); $('a.contactus).css('margin', '4px'); $('a.contactus).css('display', 'block'); Now I ...

.slideToggle inside div not working in IE7 mega menu

I have built a mega menu, where when you click on the nav link it opens, and when you click again it closes (that works correctly). There is also a close link inside that should toggle it closed when clicked, However in IE, it just reopens it everytime it is clicked. It works correctly in Firefox, Chrome and Safari. It menu has to open ...

jQuery UI Dialog (as a bookmarklet) unable to open in webpages with frameset

I'm working on a bookmarklet which uses jQuery UI Dialog. I understand that frameset doesn't allow div to be inserted, thus the dialog won't show. Need some ideas to overcome this issue. ...

Scoping Issues inside jQuery.ajax()

I'm caching label strings by saving them into a variable, but running into weird scoping issues. I know this has to do with closures, but I can't seem to figure out what the issue is exactly. info_lbl = {}; $("#chkCorporateGift").click(function(){ var type = $(this).is(":checked") ? "Corporate" : "Personal"; if(!info_lbl.hasO...

JavaScript variable not defined error?

We have three JS files: <script type="text/javascript" src="js/pm.init.js"></script> <script type="text/javascript" src="js/pm.util.func.js"></script> <script type="text/javascript" src="js/pm.nav.js"></script> In init.js we have: $(function(){ var dirty = false; }) In util.func.js we have: function dirtyCheck(actionFuncti...

jQuery IE append ul will not apply css style

StackOverlow, Whats up! I am trying to append a new UL inside a div. It works beautifully in every browser except for, you guessed it, IE. Even though the new UL is appended under the current UL's in IE, the CSS styling is not being applied...I am not doing anything super complex. Just making an AJAX call, getting the results and app...

Internet Explorer 7 returns 'undefined' from jQuery class selector

I have a small JavaScript function that (among other things) retrieves the ID of the last element with a certain class name. var lastRowID = $(".sectionRow:last").attr('id'); It should find elements in a table that looks similar to the following: <table> <tr id="courseSection[0]" class="sectionRow"><td>stuff</td></tr> <tr id=...

Proper way to access a object property in a jquery-tmpl {{each}} statement

I'm using jquery-tmpl. My object model is simple -- SalesProspect, which contains a collection of SalesProspectAction objects. Both of those objects have a field named Status. How do I get the child's Status in the each loop? It always pulls the parent's. <script id="tmplActions" type="text/x-jquery-tmpl"> <p>${GuestName}</p> ...

Can jQuery plugins be used in cakePHP??

Hello I am not able to understand how to use jQuery plug-ins in cakePHP. I have one plug-in by the name "countdown". It has 2 js files, one html, one css file and a few images. If I were using regular javascript file, I'd have to give a name to my file and call it in the view or in default.ctp using the "$html->script('path/to/file')" fu...

jquery function is not a function

Hi! I'm trying submit some form using ajax //include jquery-1.4.2.min.js var submitForm = document.createElement("FORM"); ... jQuery.post(submitForm.getAttribute('action'), submitForm.serialize(), function(data) { bla-bla }); But there is error : "Error: submitForm.serialize is not a function" (FF) What can I do? Thanks. ...

Post form results into COLORBOX modal

I have a page with file upload form. <form enctype="multipart/form-data" method="post" action="uploaded.php"> <input type="file" name="my_file"> <input type="submit"> </form> I need to post results into a modal window created with colorbox jQuery plugin. http://colorpowered.com/colorbox/ Does anyone know how do do this? Thank...

jquery problem?

im trying to turn this jquery script into a toggle event type, thier is my script, with illustrations, to show what i want to happen. i cnt seem to intrgate it so here goes: //myElement.toggle(vote(), unvote()); // this is the toggle event $(document).ready(function() { $('.statuses').delegate('.vote_up', 'click', funct...

textarea, tinyMCE and insert an image in textarea

I want to insert an image in textarea with jquery. (I know that img tag could not to inserted in textarea). Im using tinymce <img src="image.jpg" class="po"/> <form> <input type="text" name="yassi" class="infobox"/> <br /> <textarea class="me"></textarea> <input type="submit" value="click" class="submit"/> </form> jquery: <...

Remove element when it has a specified child element

How can I delete list element if it has a child link of some defined id ? So looking at the code below I'd like to find a <li> with <a> of id=link1 and delete this li. <li class="nav-tab"> <a href="#link1">Component</a> </li> I've tried the code below but it doesn't work : $(function() { $('.nav-tab:has(#link1)').css('displ...