javascript

Ajax not firing on prototype - I think I need to unset or remove a javascript method - causing havoc help!

Hi guys, I'm working using scriptaculous library. However I'm facing some issues with inclusion of the JSON library for the prototype library. It adds a toJSONSTring and parseJSONSTRING method to all objects automatically and frankly this is causing havoc in places. Like I can't seem to use the Ajax Updater function and I suspect its bec...

Is there an easy way to save a section from a rendered web page as an image?

I want to provide the ability to save some rendered data/charts (with the titles and other information not included in the image) by specifying the coordinates and size in the browser window that contains the data I want to save. Is there any way to do this? ...

Javascript strings to object

I have two strings, one a key and one a value, which I would like to turn into an object and concatenate in a loop. For example: var data = {}; // loop starts here var a_key = 'element'; var a_val = 'value'; var a_obj = // somehow this equals { "element":"value" } data = data.concat(a_obj); // loop ends here I'm just not sure ...

Find Path of File to be Uploaded

Hello all, I would like to know the paths of certain files that a user is about to upload using my form. I know this isn't allowed using JavaScript for secruity reasons but the system I am building is an internal one for staff. Is there maybe a JavaScript certificate or something that I can place on our servers to say that I can do this...

I want unescaped characters in my cookie (jquery)

Hello I want to store the href value in a cookie, trouble is when i do the cookie is escaping the forward slashes, so for example code is $.cookie ("mycookie", $link.attr("href"), { path: '/', expires: 7 }); html is <li><a id="czechrepublic" href="/cz/cz.html">Česká republika</a></li> When i store the href it is being stored as ...

Is there a better C# ECMAScript engine than ScriptControlClass?

Implementing the ScriptControlClass was extremely easy, unfortunately the side effects with the language implementation is really starting to worry me. The goal was to have a language that was the same as the browser's JavaScript. However, I am finding a difference in case sensitivity, function declarations and behavior of scoping bet...

How to make a nav bar in a single php page with mouseovers and current page images?

I've been making pages with navigation with three states: normal, hover, and current page. Normally I just use a simple mouseover script, and I include the navigation code on every page so that I can make the link for the current page inactive, and a different, third image. This is a sloppy way of doing it. What's the best way to do thi...

jQuery - How to check for available javascript on a page?

On a html page that uses $.getScript to dynamically load .js files. Later at some point if I wish to check whether a particular .js file is loaded. How to do this? Can I check using filename.js? or do I have to check for an object/function/variable in that file? Thanks for the answers folks. You guys suggested callback function, gl...

preventing onclick page jumps

what is the best way to stop my onclick links from causing the page to jump to the top. <a name="point1"> <a href="#point1" onclick="blahblah"> <a href="javascript:" onclick="blahblah"> <a href="javascript:null;" onclick="blahblah"> Or something else? ...

Browser window close event

I want to capture the browser window/tab close event. I have tried the following with jQuery: jQuery(window).bind("beforeunload", function(){return confirm("Do you really want to close?") }) But it works on form submission as well, which is not what I want. I want an event that triggers only when the user closes the window. ...

ASP.NET GridView: How can we both postback when certain columns are clicked

I have made a RowClickable GridView which allow us to postback if we click any row in the gridview. The problem is i don't want postback to happen if i click in certain column of the gridview. The way around can be even the postback happens i need to know the Column Index from which the postback is happening. Does any body out there ...

Porting a web application to work in IE7

I'm developing a web application that uses lots of Javascript and CSS, both of my own creation and through third-party libraries. These include jQuery and Google Maps & Visualization JS APIs. I've been testing everything in Firefox 3. Things are peachy until it turns out the main target of this webapp is (cue sad trombone) IE7. I'm look...

using jquery to display words consecutively

I have a page that has 2 columns of words, 20 total, that are of a certain class (dim) and each a unique id. The ‘dim’ class defines the words as hidden. I have the following jQuery code running when I press a button: $().ready(function() { var x = 20; // will be dynamic later :-) $("#btn1").click(function() { f...

javascript and utf-8 / special characters help

Hi. SHORT VERSION OF QUESTION: So basically my question is: How can I set the javascript to use UTF-8 so that å ä ö are supported, so my javascript can add the correct values to the drop list options? LONGER EXPLANATION: Im using javascript to fill 'options' in a drop down list on my main page. The drop down lists are in a form which ca...

jQuery .live('click') only binding to first element on the page

I wrote a jQuery plugin that binds to 8 elements on a page, and I wanted to use .live() to bind the click action to a link in each element. When you click the link it should post a form using ajax. The problem is that all the links for all 8 elements submit the form for the first element on the page. When I use .click() everything works ...

Make Firefox refresh after changing fragment from an iframe

My code is in an iframe from a different domain, and I want to trigger a page refresh on the parent after changing the fragment of the URL (also of the parent). It happens on IE, but not on Firefox. Is there any way of doing it without changing the outer document (polling e.g.)? <a href="http://top.domain.com/#fragment" target="_top">c...

How do I parse the web browser address using javascript and window.location ?

I'm finding it impossible to search for a particular value within the Address Bar. var str = window.location; //var str = "http://www.website.com/78203/"; var x = str.search(/78203/i); alert(x); The above code returns nothing, and in fact kills the running of anything else (indicating an error) but nothing is thrown in the console....

extjs datastore send to server (datastore -> json)

Hello All: Getting Json from the Server and displaying it in the grid is relatively straight forward. In the application (http://pssnet.com/~devone/extjs3/loadSelection5.html) I generate a dynamic grid datastore. I need to send this to the Server for further processing. If there is a way to convert the data store to json, I can strigyf...

Page element that accepts dragged item from favourites bar

What characteristics must a page element have for it to be able to accept an item that has been dragged from the favourites bar? ...

When editing a text input, how do I do a specific JavaScript action on hitting "Enter" key without the form's onSubmit handler?

I have an HTML input text field. How can I perform a specific JavaScript call when hitting "Enter" button while editing that field? Currently, hitting "Enter" reloads the entire page, presumably due to submitting the entire form. NOTE: This HTML/JS code is merely included as a portlet into a large HTML page for a portal, which has one...