javascript

Parenthesis around functions in JavaScript

Possible Duplicate: Explain JavaScript's encapsulated anonymous function syntax I've seen this code: ( fab.nodejs ) ( function() { this({body: "my app" })(); }) I wonder what the outer parenthesis do? ...

Need to override Search Filter url param (_search) in jgrid the jquery plugin?

Hi I have created a user message page with this plugin. The grid will show the user inbox and the user outbox(sent) messages. here's a little code: jQuery(document).ready(function() { //...some stuff currentURL = function() { return 'json_member_mail.php?task='+ currentBox; //where cur...

"this" in a javascript function?

I understand that "this" is a reference for the caller object. I'm used to see "this" in code like: var Person = function() { this.name = "foo"; } But then I saw these lines of code: Example 1: function helloWorld1() { this({ body: "Hello world!" })(); } Example 2: I also seen this code: function helloWorld2() { this ...

jQtouch Sort Buttons

Dear all, I looked at the documentation of jqtouch but I could not figure out how to create iphone style sort button group like this attached picture. http://img843.imageshack.us/img843/8669/captureov.png Do you have any idea how to do this with jqtouch, is there any plug-in doing this for jqtouch? Thank you for your response, cas sak...

Passing variables to JavaScript inside a URL?

I'm dealing with a web-service that serves video files (host). They provide you with a Guid which is used in an embed code (link to js file). Their URL's are structured like this: http://www.foo.com/34534525lsjda345435/script.js Somehow, the script.js parses this URL and retrieves the variable. Can someone clue me in how this is done?...

jQuery if new line, add +1 to line count

I am making a javascript code editor online, and right now I'm doing the line count on the left side of the editor. I can't figure out how to make it so when a new line is created, it adds +1 to the line count, so each new line it it will have the line number on the left. Anyone know a good way to do this? ...

Javascript/JQuery variables combined with GET variables in URL headache

I have a form, where a user selects a chart from the Google Graph API. These variables are submitted to the URL, via the GET method (this has to happen, I can't do POST). <form name="chart" method="get" > <select name="chartType" <option name="oMeter" value="http:\/\/chart.apis.google.com\/chart?chxl=0:|0|50|100&chxt=y...

Chrome, Javascript, JSON and __proto__ -- where are my methods?

I've got a function: function createOrLoadDB (host) { var db = JSON.parse( window.localStorage.getItem(host) ) if ( db == null ) { db = new InitDB(host) } else { ...

JQuery .html() question

Hey, I have a menu made with HTML, using a simple UL with lots of LIs. Each item contains a link with class "primary". When a list item (anywhere in a list item - not just the text) is clicked, jquery checks to see if the item contains a link with class "primary", and if so it loads the specified page into a hidden div (which I refer to...

How to debug events on page with jQuery

Every once in a while, some feature on a site I use will be broken/have annoying behavior that I want to change with a greasemonkey script. When I try to debug the site using firebug to find out what code is called from an event by using "Break On Next", firebug just breaks immediately to show some jQuery code that is always running. A...

The image's dimension is different from when it's loading and after it loads.

I have a page that loads a lot of fairly large images (about 200 of 100Kb images [about 600 x 400 px]). What I'm trying to do is manipulate the photo if it's in portrait, as opposed to landscape. The problem I'm experiencing is that when i use javascript to grab a portrait photo's properties when it's loading, the height is significa...

How do I highlight all invalid dijit.form.ValidationTextBoxes on a dijit.form.Form?

Hi everyone, what I'm after is a form that when submitted, runs a validation check, and highlights all invalid fields and adds the tooltips. I'm effectively looking for something like this: dojo.forEach(dijit.byId('myForm')._invalidWidgets, function (thisWidget,index,array) { thisWidget.displayMessage("normal invalid/empty message ...

Random number generator without dupes in Javascript?

I need help with writing some code that will create a random number from an array of 12 numbers and print it 9 times without dupes. This has been tough for me to accomplish. Any ideas? ...

What's the .apply jQuery function?

I see that in different plugins and codes, but I don't understand what does that function... In the jQuery api isn't referenced! ...

View source of PHP, Javascript, and HTML?

I've got a .php file with javascript, php, and html. I want to include a button/link to view the source of the entire file "pretty printed", but I can't seem to get anything to work. What is the best way to do this? ...

jQuery not working in AJAX loaded DIVs

In the HEAD of my document I load jQuery.js and also the blockUI jQuery plugin. In the PHP I then use regular AJAX to load other PHP content into DIVs. In the original PHP jQuery and blockUI plugin work just fine, but in any of the ajax-loaded divs jQuery and blockUI both do absolutely nothing. No console error, no warning - nothing. I...

any one know how i add file manager to asp.net ajax toolkit editor?

any one know file manager for asp.net ajax toolkit editor? i know there is other editors but i want know if ajax toolkit editor can have file or/and image manager . thank you. ...

MAC address in PHP/JavaScript/.NET ?

How can I get MAC address with using PHP, JavaScript and .NET ? ...

How Does One Trigger Click Event When Link Is Above Another Link?

I have a link covering which contains an image and a paragraph on a page, there is another link is positioned over this one and has a higher z-index. When I click the link the event handler for the link below is triggered. How do I trigger the event handler for the above link? Edit: To be more specific, the link that is underneath is...

What does Chrome do to speed up page rendering?

I've heard Google claim that Chrome uses certain techniques to be faster than other browsers; in particular I heard it has something to do with handling Javascript differently. Can someone explain what techniques Chrome uses to speed up page rendering? ...