javascript

ms ajax $find('clientID') keeps coming up with error

Hi. I have a modal extender called modal2 and when I call $find('modal2').show(); It comes up with a classic error saying 'null' is null or not an object; I searched google a bit and made all the related controls to be visible for testing purpose but it has not made any difference. Any suggestions please? Thanks. ...

Possible preventing repaint when dynamically inserting script?

Hey, As I've understood the browser will freeze all DOM rendering when it sees a script tag and only continues once it has processed it. When I inserted an external javascript file (typekit) directly in the HTML this seemed to be the case, but now that I'm including it dynamically it causes a repaint of the window. Is it possible fixing...

How to use form information to auto populate a form on another webpage

I am trying to figure out a way that I can populate form fields on webpage for my users much like password managers do. The problem is that I am not the owner of the second webpage. I thought about using javascript with iframes but that doesn't work. I've tried using php to replace the form information adding values saved from my previou...

Cross-browser JS inconsistencies

I have a PHP script that allows image upload. I modified it slightly to load newly uploaded image into a modal window in order to allow manual crop, if needed. It seems I got it working in FireFox (all the way until actual crop). IE throws an error: "Object does not support this property or method" and Opera just chokes and does not k...

What are some options that exist for osx like MacRuby, but using javascript?

Just wondering what are some of the options out there people know of. Only thing that comes to mind is titanium. curious what other people use. ...

How to return and use an array of strings from a jQuery ajax call?

I'm using Google App Engine (Python) along with jQuery for Ajax calls to the server. I have a page where I want to load up a list of strings in Javascript from an Ajax call to the server. The server method I want to invoke: class BrowseObjects(webapp.RequestHandler): def get(self): ids_to_return = get_ids_to_return() ...

How to replace src attribute name with data attribute name

I have a html document which uses object tag with src attribute. But I need to replace src(attribute name) with "data" (attribute name). Is it possible to do so using JavaScript? All I referred shows that we can change the attribute values, but I couldnt find any method to replace attribute node name. Could someone please help ...

JavaScript function declaration and evaluation order

Why does the first one of these examples not work, but all the other ones do? // 1 - does not work (function() { setTimeout(someFunction1, 10); var someFunction1 = function() { alert('here1'); }; })(); // 2 (function() { setTimeout(someFunction2, 10); function someFunction2() { alert('here2'); } })(); // 3 (function() { setTimeout(fun...

Using label2value script, need it to validate form because other validation scripts cause issues

I'm using the following script to do inline field labels, but I would like to have it also validate the fields before the user submits the form. I only have 3 fields in the form, Name, Email and File upload, can anyone please help me? If I use a separate validation script, it will not recognize the fields as being empty because this scri...

How to focus in div tag in javascript

I have created a tabs using div tag in javascript. I have asp.net button on each tab. whenever I clicked on button the focus is set to first tab. I am using following code in page load event. HtmlGenericControl content_1 = new HtmlGenericControl("content_1"); HtmlGenericControl content_2 = new HtmlGenericControl("content_2"); HtmlGener...

Select element by and classname in javascript

I have an onChange event that needs to dynamically select an ID and then add a preset classname to pass to a function. onChange = "show(document.getElementById(this.value). {select a class here? } );" The equivalent in jquery $('#'+this.value+'.myclassname').function(); So how do I select an ID+classname in javascript? I know I'm ...

Will Javascript ever get rid of semicolon at the end?

I hope I won't get downvotes in this post. But I can't figure out why Javascript needs you to insert semicolon at the end. Can't it figure out when the line ends? And will Javascript ever get rid of semicolon you think? ...

Will we soon have online IDE that is based on Skywriter?

I saw that Skywriter is released and it looks promising for people that want to create online IDE for other programmers. Will we soon have online IDE that is based on Skywriter you think? ...

How to work with with Google playground code in offline?

<script type="text/javascript" src="http://www.google.com/jsapi"&gt;&lt;/script&gt; This script it need to call from Net.is that possible to download the code ...

Javascript: This if statement should not detect 0; only null or empty strings

How do I NOT detect 0, but otherwise detect null or empty strings? ...

How to call function using the value stored in a variable?

I have a variable var functionName="giveVote"; What I need to do is, I want to call function stored in var functionName. I tried using functionName(); . But its not working. Please help. Edit Based on the same problem, I have $(this).rules("add", {txtInf: "^[a-zA-Z'.\s]{1,40}$" }); rules is a predifined function which takes metho...

Intercepting DOM and JS engine calls

Hi All, I want to intercept DOM object read and write queries fired by JS while getting loaded by the browser. After intercepting these calls, i wish to screen them. I have written the logic for screening but am not able to block the calls. Is there any way other than modifying source code of the browser to achieve this? If so pls help...

Sliding out Div, Slide in another Div at the same time.

Ok, I have a few divs within a section of HTML. I need some help getting the Div tags to slide out (either horizontally to the left/right or vertically going up/down, depending on a setting). But at the same time when a div is sliding out of the page, I need another div to slide in from the opposite side of the page. So it will sort o...

URL Hash oddities

I've noticed some strange behaviour in JS window.location.hash = ''; var hash = window.location.hash; alert(hash + ' = ' + hash.length); //outputs: ' = 0' window.location.hash = '#'; hash = window.location.hash; alert(hash + ' = ' + hash.length); //outputs: ' = 0' window.location.hash = '_'; hash = window.location.hash; alert(hash + ' =...

How to use onclick on a iframe tag

How to use onclick in iframe tag to call a javascript. I basically want redirect to other page when a user clicks on a iframe.I have added the facebook like button my site which is a iframe code. So once he has clicked on the like button i want him to get redirected to a thank you page EDIT: i don't want to redirect the iframe but i w...