javascript

In jQuery, how do you resolve the scope of "this", when you are in the scope of each()?

I've created an Object, and have a method setup() in the object. this.debug = function (){...} this.setup = function(){ var fieldsets = form.children("fieldset"); fieldsets.each(function(){ this.debug($(this).attr("class"))); }); } I'm trying to call this.debug which is in the scope of the Object but not in...

How invoke live method with arguments

I am learning how to write jQuery plugin. So why I am doing what I am doing does not matter. I writing a plugin called live2 which does nothing else but internally calls live method. (function($) { $.fn.live2 = function() { /* if there are no elements then just return */ if (!this.length) return this; ret...

Javascript for..in and jQuery's $.for() don't work for XMLHttpRequest in IE

UPDATE: The problem only occurs when I use an older version of jQuery (1.3.2) and not on the newest version (1.4.2). ORIGINAL QUESTION: I have found a weird behavior, and am wondering if there are any work-arounds. The javascript 'for' loop can be used to enumerate the property names of an object. I am finding though that on IE it d...

PHP/Javascript passing message to another page

Hi.. So let me explain: I basically want so when you post a comment, (i use a js/jquery script to send string to insert.php which inserts to the database) you will receive 2+ points. Now i have done so you get +2 points, BUT i want to display a message like stackoverflow. I already know how to display a message like stackoverflow, but i...

vb.net passing a value of text box in javascript function

MotherTongueTxtBox.Attributes.Add("onblur","val_Length(MotherTongueTxtBox.text,"hi friends",Length);") in the above statement val_length s a javascript function in tat function the first parameter shd b the contents of the text box ,the second parameter s a string type, is the statement correct i think it s wrong can u suggest a correc...

jQuery div autoscroll

Hi I am looking for advice on how to create an autoscrolling effect using jQuery which would enable an entire div within a page to begin scrolling vertically upon loading at a constant slow speed. This would be a div with a large amount of content of which only a small amount was visible on the screen at any one time. The scroll needs...

Css background images not being cached by FireFox

I am dynamically adding <link> tags to the page using YUI3 and this works properly. For testing purposes I have two nearly identical css files which include the exact same background images however when I load the second css file, Firebug shows that more http requests are being made for the same images in the first css file. The JS Y...

What is it called when a popup appear "over" a wepage?

when you visit http://www.daniweb.com you get a popup window, what is this called + any idea how to do it? Thank you for your reply, what is the simplest way to do have a modal loading animation only i.e. when page loads that animations shows and when done the animation goes? ASP.NET/Ajax ...

Custom div loading not working.

To those jQuery experts out there. I have the following markup and code: <html> <head> <title>Test Framework</title> <script src="js/jquery-1.4.1.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function(){ $('.nav').click(function(e) { e.PreventDefault(); var id = $(this).at...

Handling file uploads with JavaScript and Google Gears, is there a better solution?

So - I've been using this method of file uploading for a bit, but it seems that Google Gears has poor support for the newer browsers that implement the HTML5 specs. I've heard the word deprecated floating around a few channels, so I'm looking for a replacement that can accomplish the following tasks, and support the new browsers. I can...

Jquery, Convert Title to Slug

Hi Guys, I have a PHP script that does the following: It takes a string, for example, "This is a Great Blog Post, #1!", and returns the following string, "this-is-a-great-blog-post-1". I'm not exactly a Jquery expert, that's why I'm asking this question. Does someone know of a Jquery (or Javascript, for that matter) script that will d...

link_to_function with rails 3

Hi, link_to_function raise an error with rails 3. undefined method `link_to_function' for #<Class> How can i do to have a link with a simple onclick, with the new rails 3 syntax? Thanks ...

Classic asp server-side JSON library

I have inherited some classic asp code and I need a JSON library that can be instantiated and run server-side for use with JavaScript-coded server-side asp. How can I do this? ...

Is there a website where I can see which HTML 5 tags are supported in in different browsers? And WebGL?

I want to make an HTML/Javascript web app. Is there a website where I can compare what webrowser already support the HTML 5 tags? And WebGL? ...

What is DomHelper in google closure?

Could somebody explain what is the meaning of DomHelper in google closure? What is it for and how it may be useful? Thanks! edit: Here is a more detailed answer ...

Security and JavaScript files containing a site's logic

Now that JavaScript libraries like jQuery are more popular than ever, .js files are starting to contain more and more of a site's logic. How and where it pulls data/information from, how that info is processed, etc. This isn't necessarily a bad thing, but I'm wondering to what extend this might be a security concern. Of course the real ...

Javascript: What does the function given to setTimeout get called with?

I have code like this: setTimeout(foo, 600); I always thought that foo didn't take any arguments, e.g.: function foo() { /* bars */ } However, doing the following: function foo(a) { alert(a); /* bars */ } Popped up an alert displaying -7. What does this number represent? ...

i doesn't start at 0

This code alerts 'test 1', then alerts 8! uri = 'http://www.scriptcopy.com/'; compareuris = new Array(); compareuris[0] = 'http://www.scriptcopy.com/'; compareuris[1] = 'https://www.scriptcopy.com/'; compareuris[2] = 'http://www.www.scriptcopy.com/'; compareuris[3] = 'https://www.www.scriptcopy.com/'; compareuris[4] = 'http://scriptcopy...

Can anyone help me make this an object. (php)

Hey, can someone help me make this an object please. Obviously not all my code is here, but i'm sure you'll get the gist. <?php $product_name_1 = $_POST['product_name_1']; $region_1 = $_POST['region_1']; $start_date_1 = $_POST['start_date_1']; $end_date_1 = $_POST['end_date_1']; $sku_1 = $_POST['sku_1']; $product_name_2 = $_POST['prod...

Javascript: What argument does the function specified in body's onload event get called with?

Similar to this question, my HTML looks like this: <body id="body" onload="loader()"> </body> I always assume, as this doc says, that onload is given no arguments. However, I named the argument, and did some deep inspection, and found that I got an object looking like this: {originalTarget : DOM, preventCapture : function, target :...