jquery

What is currently the best HTML/CSS/Javascript configuration?

I'm getting more into jQuery and so have set up a HTML/Javascript/CSS base site which I use for all my tests. Since these tests will eventually turn into PHP and ASP.NET MVC websites, I want to use this opportunity to get the basics down right again for modern browsers and web standards before building the scripting languages on top of ...

jQuery - Show/Hide items individually with same class name

I am an extreme noob with jQuery. I'm trying to show an item based on it's corresponding link...without showing the other items. All my links have the same class name, as well as the spans. I don't know if this can be done or not...been racking my brain for too long on this one. Here's the code: <html> <head> <script src="http://ajax...

jQuery - IE6,7 not suporting $(this) ?

Hey, I have a code, that works in all modern browsers, but not in IE 6,7. $('.cat1').toggle(function() { $(this).parent('li').next('ul').slideUp(); $(this).css('background-position', '0px 0px'); return false; }, function() { $(this).parent('li').next('ul').slideDown(); $(this).css('background-position', '-210px...

Jquery: how to detect a textbox's content has changed

I want to detect whenever a textbox's content has changed. I can use the keyup method, but that will also detect keystrokes which do not generate letters, like the arrow keys. I thought of two methods of doing this using the keyup event: Check explictly if the ascii code of the pressed key is a letter\backspace\delete Use closures to r...

Why does $(document).ready(function()... not work in this example?

Why does $(document).ready(function() not work in the following example? If I take it out, the other jQuery statement works. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head> <meta http-equiv="content-type" c...

KeyDown event gets invoked twice

I've got this Prototype code to detect Enter pressing in textarea. document.observe('keydown', function(e, el) { if ((e.keyCode == 13) && (el = e.findElement('.chattext'))) { e.stop(); // foo bar } } And html <textarea id="chattext_17" class="chattext" cols="20" rows="3"></textarea> But the problem is, that ...

Making parent link unclickable in a drop-down menu with jQuery

Hello everyone! I have a drop-down menu that are dynamically added through WordPress. It looks like this: Pictures Sea Forest City "Sea", "Forest" and "City" is categories with "Pictures" as parent category. My question is: How do I make the "Pictures" category unclickable? I did this with jQuery: $(document).ready(fu...

How to make a simple jQuery button in XHTML strict with no form postback?

I am making a site with DOCTYPE XHTML Strict and it complains if I have an input button or button element outside a form. So I put it in a form and it complains that I don't have an action attribute. So I put in an action attribute but then the buttons postback to the page, which I don't want. How can I just have a normal jQuery butto...

Is there a jquery plugin that does this better? Text drop down list (Not a menu)

On the following page, I created a quick mock up of what I've been looking for. Here's the issue with my example: 1) It needs to be inline so it can be part of a sentence. Like.. Welcome to my blog, check out some of the [Categories]. Some more text after. 2) When the box examples, it should overlap the content below rather than push i...

Getting Better Error Message From ASP.Net [WebMethod] Called From JQuery

[NOTE:I am really looking for some good debugging techniques here. Perhaps some tricks or ways to simplify things of which I am unaware.] I am using the technique of calling [WebMethods] defined in an ASPX page from JQuery as mentioned here and here. It seems to be an increasingly common method. I've been using it for a while and, in g...

Jquery and opensocial (particularly orkut)

I want to develop a webpage which fetches some data from my orkut account using OpenSocial APIs. The language I am working with is Javascript and I use jQuery. However I must admit that I an novice as far as JS is concerned. I have looked at opensocial-jquery, it seems restricted to gadgets and jOpenSocial lacks any good documentation an...

jQuery - triggering function after click on <option> tag

Hello, I've got this code, that works in the latest version of firefox, opera and I'm not sure if in IE8, but it doesn't work in Google Chrome, Safari and ofc IE7 and 6. The script I have is a bit more complicated, but the problem is in this: <select> <option class='gramaz_vyber'>1</option> <option class='gramaz_vyber'>2</option> </s...

How to handle ESC keydown on javascript popup window

I have a javascript window.open popup, and I want the popup to close itself when the user presses the ESC key. I can't figure out how to hook the keydown event (and on what object?) so that I can catch the ESC key. I'm using jQuery. ...

Any tutorials for using JSON, JScript and jQuery?

I just recently started using jQuery on my classic ASP site. I am planning on rebuilding a page that has 4 sections and each section displays multiple rows and columns. JSON can help me here but all the examples that I have seen are VBScript related. This site is JScript and I am looking for some examples or tutorials using JSON, JScript...

Toggle function in jquery

I have a button on click of which i want to either show/hide a content which is places in a div. How can we implement this? Also whats the error in the code below-- <head runat="server"> <title>Toggle Functionality</title> <script src="jquery-1.3.1.js" type="text/javascript"></script> <script type="text/javascript"> $(document)....

How to a reference an HTML element with id+class in jQuery?

In the following javascript/html, I can reference div.answer but how do I reference div#flashcard-001.answer? HTML: <div id="flashcard-001" class="flashcard"> <div class="question">What color is the sky?</div> <div class="answer">blue</div> <button class="show">Show</button> <button class="hide">Hide</button> </div> J...

jqueryui dialog, direction of slide

I'm using jquery dialog and want to slide on show. How do I specify the direction of the slide? $('.selector').dialog({ show: 'slide' }); ...

Waiting x milliseconds after an event, recheck and trigger

I currently have a jQuery.event listener, which once triggers will display an otherwise hidden element (a rollover, basically). However, is there a way I can get jQuery to wait a few milliseconds, recheck to ensure the mouse is still over the element and then trigger the .show() event if it is? I currently have: $("#who-mousearea").mo...

Is there a way (In PHP) of detecting if the script was called by jQuery load or not?

I'd like a script that could detect if called by jquery If not, it'd display the page+layout, if not, it'd just so the content (but that is irrelevant) But yeah, a way of detecting if it was called by jquery load - ajax - or directly requested. Cheers! ...

Problem with IE8 using AJAX

Hello, Can anyone help me with this IE8 problem, my app is work fine in FF but Ajax Functionality is not working in IE8 function createXMLHttpRequest() { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari return new XMLHttpRequest(); } if (window.ActiveXObject) { // code for IE6, IE5 ...