jquery

AJAX URLs and GET requests

Ok, a great example of what I am trying to achieve is at Google Translate. The URL: http://translate.google.com/#en|es|this is what I am trying to do makes a GET request using this URL: http://translate.google.com/translate_a/t?client=t&text=this%20is%20what%20I%20am%20trying%20to%20do&sl=en&tl=es&otf=1&pc=0 I'm not ...

Should I use jQuery.inArray()?

I'm doing very frequent searches in arrays of objects and have been using jQuery.inArray(). However, I'm having speed and memory issues and one of the most called methods according to my profiler is jQuery.inArray(). What's the word on the street about its performance? Should I switch to a simple for loop? My specific function is: func...

Expanding DIV solution with jQuery, CSS, or Both?

I have an HTML page layout - something like this: <div id='header'> Header content </div> <div id='main_content'> some content </div> The content in the #main_content div may be really long, or, next to nothing (i use it as part of a template across an entire site). What I want is for it to minimally be the height of the viewport (m...

Refactor Jquery code into function for reuse

Hi there.. Looking for some assistance if possible. I have created some jquery code that does the job, but i feel is a bit cluncky, and would like to refactor it correctly... At the moment the code responds to a click by the user, it checks on server if the user is allowed to vote, if so, it processes the vote via ajax, and moves the ...

jquery - count divs with ids in an array?

Not sure how to do this with jquery, but I'm trying to return a count of the number of divs that have specific classes... <div id="main"> <div class="contact">Data</div> <div class="margin">Margin</div> <div class="contact">Data</div> <div class="break">Break</div> <div class="break">Breaker</div> <div class="nap">Nap</div> </div> A...

jquery how to only allow effect on assigned div, not children

I have applied an mouseenter effect to a div. When you enter the div, it then animates another div. The problem is, the mouseenter effect applies to the children div as well. How do I apply the effect to just the parent div, but animate the children div? JS: $(document).ready(function() { $('#slideleft').mouseenter(function() { v...

jQuery text match

I have an anchor tag with text and I want to check if the given var matches the string exactly. This works, but I would like to use something other than contains, since it will match two elements if the contain the given string. I want it to match exactly. Any ideas ? function test(submenu){ $('a:contains("' + submenu + '")', 'ul.subM...

SOLVED: What is the OO approach to accessing jQuery plugin methods from my plugin HTML?

I started with this question: http://stackoverflow.com/questions/1875693/multiple-javascript-gadgets-per-page . After reading up on how to build a jQuery plugin I've modified my OO JavaScript object into a jQuery plugin by wrapping my JS object in (function {} { /*my object code*/ }(jQuery)) and adding a function createMyGadget() {...

Wait Untill print is complete - Jquery Asp.net MVC

Hello, I am a newbie. please excuse me if it is a very basic question. I am hiding and showing CSS on window.print(). on IE8 and FF The page execution stops until i respond on print ( either print or cancel) and then it starts again and completes the page load. But on IE6 and IE7 the page load is not waiting until i respond on print d...

Creating custom/intutive layout for controls

Hi, I have an address control which display the contact info of the person. so it displays something like 1234, street City, CA 12345 Now i want to give user flexibility to create format out of it. For ex someone might want to display address as, street, City, Country OR Just display their emails: [email protected] [email protected] Any good ...

Toggle a div closed if a #something is present in a URL

How can i toggle a div closed using jquery ie hide the box below (close it) if #something is present in the URL http://www.mydomain.co.uk/index.php#something <div id="feature">content</div> ...

jQuery selector question

hi all, here's my markup: <div class=container> <ul> <li class=record> <div class=item></div> <---- I am here </li> </ul> </div> the container is always present, but the UL is optional. what i want to do is get the "next parent" - element (from my current item), either li.record (if present) or...

Most efficient way to GET images using jQuery AJAX

Reader's digest version: What is the most efficient way of requesting an image from a server and placing it into the DOM using AJAX (or AJAI, perhaps? : ) )? Here's the long version: Hello SO, I'm setting up a simple page that has a list of items, and when you click on one, it does the following: Clear the modal dialog on the page (wh...

Iterating through table rows in nested divs

I have a page that contains a couple of layers of nested div tags. Within the the 8 or 9 of the divs are tables. How do I iterate through the divs and pick the specific divs that I want and then iterate through the cells in the table (one row) embedded in each of the divs? Here is a representative sample of the page that I want to ite...

jQuery selector help - Can I generate a selector from clicking on an element?

Hi All, I have jQuery, FireFox, Firebug, IE, and IE developer toolbar. When I am examing a page with either FireBug or IE Dev toolbar, I am able to click on an element and it shows me in the dom where the element is etc... Is there anyway to transform that selection into a valid jQuery selector? I know I can use ID, classes, and element ...

can i bind cell values of an html table to a data object to pass to an asp.net mvc controller

i have a form that i am submitting to my controller. I created a data class that is used to pass into my controller to do something like this: [AcceptVerbs(HttpVerbs.Post)] public ActionResult Update(ApplicationUpdater applicationUpdater_) { } the issue is i used to have a list in a multi select dropdown and that simp...

Determine if an iframe is visible on the screen

Hello! I have an iframe that is being loaded into external sites of which I cannot put any code in. What I would like to be able to determine from within my iframe (different domain) is if the iframe is currently within the 'viewport' of the browser (or if it is scrolled off the page). Is there any way for this to be done? As I do not ...

Possible to print list items hidden by Jquery "slideup" function

i'm trying to get this accordion to expand when printed. the code degrades gracefully when javascript is turned off, but it just doesn't expand when printing. here's a demo of it so you can see how it works: http://evanmoore.webs.com/test.htm thank you so much for your help! below is the code: <style type="text/css"> @media print { ...

jQuery: extend plugin question

hi all, i'm having this simple plugin code: (function ($) { $.fn.tWeb = function () { var me = this; me.var1 = "foo"; this.done = function() { return this; } return this.done(); }; })(jQuery); var web = new jQuery.fn.tWeb(); alert(web.var1); works nice - alert(web.var1) is giving me "foo". my q...

Multiple jQuery UIProgress bars

Hello, I'm trying to display multiple, "static" jQuery Progress Bars on a single page, all with different different values.... Anyhow, say I have this bit of code: $(function() { $(".progressbar").progressbar({value: 37}); }) Is there a way to use the same class for multiple "instances" of the progress bar? And is it possible to pass...