jquery

jQuery: Link changing when modifier held down - but link stops working

Hi folks, I'm trying to create a link that points to URL 1 normally and to URL 2 when the shift key is held down. I arrived at this code sample, which properly switches the links (as indicated in the browser status bar when hovering over the link), but clicking on URL 2 doesn't work: the browser just doesn't do anything. That's right: a...

javascript namespace as string

I have the following namespace (com.myCompany.myProject): var com = { myCompany: { myProject: { x: 1, y: 2, o: function() { } } } }; For example, I have the following code: var self = com.myCompany.myProject; How can I show this namespace as a string, e.g. "com.myCompany.myProject" ? I've tried ...

Unknown Web Method

I'm trying to implement a view tracking web service on my website. I'm using JavaScript because I want to exclude any search bots from my tracked views. The problem is I'm getting a "Unknown web method" error when I try to use jQuery to post to the web service I've created. $(document).ready(function() { $.ajax({ type: "POST", ...

position element on top of another

i am looking for a jquery plugin that will let me absolutely position one element on top of another. This plugin should understand scroll offsets, and borders. bonus points if it looks right on both ie and firefox. bonus point if it repositions itself on window resize. does something like this exist, or am i stuck rolling my own? ...

jQuery: issue on onclick of "LI"

hi friends, i've a problem with jquery: on click of "li" function, various ie versions are acting differently.. here is the html code. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head> <meta http-equiv="Conte...

need to hide/slide div once link is clicked

I display the div by clicking the link, but now I want to hide it when it is clicked again. This is what I have currently: $(document).ready(function() { $('#our-future-intro-slide').click(function() { //$(".our-future-intro").delay(2400).slideDown(3600); $(".our-future-intro").slideDown(200); }); }); So each ti...

JQuery and JS variables

Hi, a little misunderstanding with JQuery and JS variables. Simple example: function someFunc(){ var flag = true; $(function(){ $.post("/some/address/", {} ,function(data){ if( data == false){ flag = false; } }); }); if(flag == false){ return fal...

Using jQuerys document.Ready function to attach events to elements

Normal style <a href="#" id="myLink" onclick="myFunc();">click me</a> function myFunc() { alert('hello!'); } jQuery style <a href="#" id="myLink">click me</a> $(document).ready(function() { $("#myLink").click(function() { alert('hello!'); }); }); I've just started using jQuery, but I'm wondering what the diffe...

Problem with jQuery resizable inside iframe

I have a first page. Where is a link which open jQuery Dialog with iframe with second page inside. There is a resizable textarea inside second page. Actually the textarea resizable only when I open the second page strictly without iframe, but it's not resizable inside iframe. How can it be fixed? UPD: This is my html code from first p...

input[type=file] validation

Hi guys, how can I check if the input file is not empty? I tried: $('#image-file').click(function() { if ( ! $('#image-file').val() ) { alert('Chose a file!'); return false; } }); but it didn't work. ...

jQuery find elements of class name within same container

I have a UserControl in MVC which may be repeated many times on the page. Say I had something like the following: <div> <a href="#" class="enableTextBox">edit</a>" <input type="text" class="comments" readonly="readonly" /> </div> <div> <a href="#" class="enableTextBox">edit</a>" <input type="text" class="comments" rea...

jQuery not recognizing <embed> element in IE

I have a CMS where people can paste the code to embed a YouTube video. The problem is, the CMS uses jQuery lightboxes as modal popups to edit things, and the YouTube embeds are appearing over top of the popup window. I have read in many places that elements don't respect the z-index property and just stick themselves on top of everythi...

[JQuery] - How to find out position of clicked element?

How do I find out, in what position a list item was clicked. So, let's say I clicked the second list item: <li><a href="#"><span>Tab 2</span></a></li> Then, I would get an alert saying something like: You clicked the second list item? JQuery Code $('#top-betting ul li:first').addClass('current'); $('#top-betting div:not(:first)'...

jquery selector not working in IE

Hey there, these two selectors is not working in Internet Explorer 8 (they work okay in Firefox, Safari and Chrome). $(this.children).stop().animate({ color: "#4B2B26" }, 300); $(this).find('a').stop().animate({ color: "#4B2B26" }, 300); Help is appreciated, thanks! edit; I think it's a problem with jquery.js.. Each time i hover a o...

jQuery Textarea Caret Position to End on Focus

I have multiple textareas on a page and would like to set the position of the caret to the end of the text which changes per textarea (textareas do not contain similar length values). How would I initiate this on focus to move caret from the position they select to the end? Thanks in advance. -B ...

Check for :contains on .Load()'s responseText

I'm trying to figure out how I'd add a contains to check that the responseText coming back in the callback of a jQuery .load() contains a certain string of text: $("#ordersList").load("OrderHandler.ashx?action=" + action, function(responseText, textStatus, XMLHttpRequest) { if(responseText) { ...

JQuery: How determine child ordinal position? Need: $("#parent").ordinalChild('#some-child') => 3 (say)

Because Jquery UI tab doesn't support passing id selector to remove() tab method, and no method exists to map id to index, I have to painfully "jump hoops" to determine the index of the tab I wish to remove. I just searched the documentation for JQuery and wasn't able to find a utility method to return an integer of the ordinal positi...

How to calculate time between key pressed

Hi there I wanna calculate the time between key 37 and 39 pressed. This is the left and right key. So the user would press the two keys and i must calculate between each 2 key presses how long each gap was. ...

jQuery Javascript large scale application development

Hi, I have just been asked to describe the architecture for a large scale dashbaord style project that i will be working on. I have bever worked on a application of this size and am a bit lost as to what to say. Could i be pointed in the direction of any articles that may help me get started and hopefully finished. I have gleaned the...

How do i get rich controls in PHP?

Hello, How do i get rich controls like tree, calendar etc in PHP? PHP by default doesn't include any such controls. I am planning to use either CakePHP or Zend framework as i heard from my friends that these two are really nice frameworks. Do these frameworks include support for tree and such controls? I actually come from Asp.Net and J...