javascript

state of HTML after onload javascript

hi there, many webpages use onload JavaScript to manipulate their DOM. Is there a way I can automate accessing the state of the HTML after these JavaScript operations? A took like wget is not useful here because it just downloads the original source. Is there perhaps a way to use a web browser rendering engine? Ideally I am after a s...

Nested Maps in JQuery ajax data to send - how to serialize 'properly'?

var location = { "location" : { "name" : $("#user_loc_name").val(), "street_address" : $("#user_loc_street_address").val(), "city" : $("#user_loc_city").val(), "province" : $("#user_loc_province").val(), "country" : $("#user_loc_country").val(), "postal_code" : $("user_loc_postal_code").val(), "publ...

Add absolute hyperlink URL

I have the part of the jquery code success: function(results) { if (results.d.Product.length > 1) { var html = '<h3>' + results.d.Product+ '<h3>' + '<div>' + results.d.ProductDescription + '</div>' + '**<a href="#">' + results.d.Url + '</a>';** $(test).html(html); ...

What does JavaScript >> stand for?

I'm translating a JavaScript algorithm into PHP, and I ran into the symbol >>, and I have no clue what it means. It's hard to search Google for symbols, so can anyone tell me what it means? ...

How do you set, clear and toggle a single bit in JavaScript?

How to set, clear, toggle and check a bit in JavaScript? ...

Need a way to return scroll window position after page refresh

I am writing a game in PHP/Zend Framework and Facebook JavaScript. The gameboard is displayed in a scrolling window. To view the entire gameboard, the user must scroll around. Each step of the game causes a page refresh, so when the user moves on to another step, their scroll postion is lost and the window is returned to it's default pos...

Bookmarklet Image Question

I'm trying to make bookmarklet to IF(url ends in .jpg || .png || .jpeg) dosomething(the url) ELSE onhover of any image, put a 50% opacity red cover over it. And onclick something(this.src) Catch, there might be a link already around it: ...

moving a div - styled cursor:move

Hello I have a div for which i have set the cursor:move style. The div shows up as a modal popup window. I would like to let the user move the div around. <style> .popup{cursor:move;position: absolute; width: 100%; height: 100%; top: 0; left: 0; margin:auto;} </style> <div id="modaldiv" style="popup"> content goes here </div> An...

IE8 JavaScript: select.options behaviour

I've today discovered some strange behaviour in IE8's implementation of the DOM select element's JavaScript 'options' property. Given the following HTML: <select id="sel"><option value="val">An option</option></select> And the javascript: var sel = document.getElementById('sel'); alert(sel === sel.options); //alerts 'true' in IE8 ...

Problem accessing ExternalInterface exposed method in Google Chrome

My simple ActionScript I am trying to use Flash's ExternalInterface to setup a callback so that JavaScript can call a method on my Flash object. Everything works fine in Safari, Firefox and in IE, but I cannot get Chrome working. When I try the code on Chrome, I get the following error: Uncaught TypeError: Object #<an HTMLObjec...

Best Rich Text Editor for web application having dynamic form

Best Rich Text Editor for web application having dynamic form with many text editor. 1)text editor can easily trnsform textarea 2)Light weight ...

Wrap jQuery function

Hello all, I'm developing a Firefox addon, after nominating the addon for public release in Firefox addons site, the reviewer asked me to wrap all my function inside a namespace or package name. So far I've wrapped all my functions except "jQuery" function: myaddonname = { initialize: function() { var prefManager = Components...

can I programmatically examine and modify Javascript event handlers on html elements?

I am doing browser automation using C#, and I would like to modify or possibly just eliminate event handlers on some of the html elements in webpages that I am looking at. E.g., suppose there is a button there which might (or might not) have an attached onClick event. How do I go about: - finding out if there are any event handlers attac...

How does caching work when a javascript file is loaded?

Hi I have some tabs that are ajax powered. So everytime a tab is clicked all data is loaded including javascripts. So if they click on say Tab A then click on Tab B and finally Tab A. All Tab A scripts will be loaded twice. Now I am wondering how does the caching work. On the second time they click on Tab A how much faster will these s...

how can I find a referenced Javascript method in a big website?

suppose I look at a webpage and I see something like: MysteriousClass mc = new MysteriousClass(); mc.CallMysteriousMethod() Now, the problem is that there are a zillion javascript files included into this page, and how am I supposed to find the one file that contains definition of this MysteriousClass? I know that this could be dealt wi...

JavaScript libraries to detect browser capabilities/plug-ins

I'm trying to find a (preferably open source) JS library to determine as much information as possible about the user's Web browser environment. I know it's possible to get such data as: Screen resolution, User-Agent, Accept-Language and other preferences usually sent in HTTP headers, Installed plug-ins (through navigator.plugins), Whet...

Detect Google Earth is installed in a web page on Internet Explorer

Is it possible in web page on Internet Explorer to detect if the Google Earth application is installed on the client machine using Javascript? This page is part of a Trusted Site on an intranet. Update: detecting it via creating an ActiveX object or any IE specific javascript is fine. ...

using javascript and css files in ASP.Net MVC View?

Hi everyone, I'm having some trouble getting a jQuery plugin to work correctly in my MVC view. Here's what it looks like at the moment: (I've copied all needed jQuery includes and css files into the /Scripts folder of the site) <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <script src="/Scripts/jquery-...

Calling a Javascript function in the C# webBrowser control

I am using the webBrowser control in c# to load a webpage and need to call a JavaScript function that returns a string value. I got a solution to use the InvokeScript method, and i tried a lot , but everything got failed...... plz help me ...

Pass a value and reload User Control from Javascript

Hi guys, I have a User control (because I use the same in other page, so I thought I should reuse code and not double my work), but in this page I show a list of companies and each one has a company number, I need to pass this company number to that User Control and it has to reload using that passed company number. How can I accomplis...