javascript

Storing data in Greasemonkey scripts

Does GreaseMonkey have something built in so you can store data per-site or per-page? For example, say you wanted to tweak StackOverflow.com so you can add a note to each of the questions in your favorites list and sort on that note. Does GreaseMonkey have something built-in to store those notes? Or perhaps can the scripts self-modify...

How to Silverlight Invoke Javascript function in a namespace?

I'm having a problem since I wrapped my javascript functions inside of a namespace. Version 1 of my code worked fine. Originally, to call the javascript from inside Silverlight I used to use this code: HtmlPage.Window.Invoke("hideMyDiv"); My javascript looked like this: function hideMyDiv() { $('#MyDiv').fadeOut(); } Now, I've r...

Is there a way to load embedded YouTube videos faster on my website?

I'm writing a blog post that uses multiple videos from YouTube and Yahoo Video, but I'm not happy with how long it takes the page to render. Apart from using an ajax-y method to load the videos, are there any tricks that would make the page load quicker with multiple videos from different sources? ...

Javascript image.complete - What to use in Firefox.

I am attempting to use Jquery to determine if an image has properly loaded or is broken. The following works just fine (and returns true or false as of the state of the image) but only seems to work in IE, In firefox, it seems to always return "true" - even if the state is actually imcomplete: image = $("img#myImage"); alert(i...

asp.net mvc javascript postback

I'm mixing asp.net webforms and asp.net mvc. To use webforms I've included routes.IgnoreRoute("Reports/{*pathInfo}"); in the public static void RegisterRoutes(RouteCollection routes) method. It seems to work just fine. But javascript postbacks on the asp.net webform pages don't work. Specifically <script type="text/javascript"> fun...

Adobe AIR - What is the proper method for using an EventListener on a newly created window?

I'm very new to AIR development, and have just started seriously building my first simply application. I'd like to open a new window to prompt the user for desired settings upon first run. In testing the new window and detecting its closed state, I've done the following (some jQuery code included): The following code is used to open t...

JavaScript Not Working in Internet Explorer

I'm currently styling my username/password inputs on a webpage. They are working as intended in Firefox/Safari, but Internet Explorer throws the following error: Line: 7, Char: 2, Objected required It happens when I give focus to my inputs. This function is called onfocus: function InputFocused(InputID) { var InputObject = documen...

seting proxy in javascript

the following is the code for seting proxy on server side. # System.setProperty("http.proxyHost", "220.134.110.231"); # System.setProperty("http.proxyPort", "80"); I want to achieve the same thing on clint side. Means the people visit my webpage (it will contain some javascript/applet). so my applet /javascript code should do this ...

Set array of values on ActiveRecord model from HTML view

I need to have a view able to update an array attribute on a model such that I can dynamically add things on the view to be able to add this. Does that even make sense? Basically a Foo has urls. So in the DB I just have a text datatype that I want to store the comma separated list of urls, and I override the default AR setter and getter...

How do i escape this code to work in JavaScript?

<!-- Begin: AdBrite, Generated: 2009-08-03 19:56:32 --> <script type="text/javascript"> var AdBrite_Title_Color = '78B749'; var AdBrite_Text_Color = '000000'; var AdBrite_Background_Color = 'FFFFFF'; var AdBrite_Border_Color = 'CCCCCC'; var AdBrite_URL_Color = '0000FF'; try{ var AdBrite_Iframe=window.top!=window.self?2:1; var...

Removing appended html using jQuery?

Using jquery, I currently append html to a div on a click event. The following code allows me to fade in only the appended portion of the div: var html = ".."; $('<div></div>').appendTo("#id").hide().append(html).fadeIn('slow'); This portion works perfectly. But how can I later remove (fade out) only the appended portion? I tried h...

Where to get the o3djs javascript libraries

I want to start messing around with o3d but I can't find where to download o3djs javascript libraries. I downloaded the plugin from http://code.google.com/apis/o3d/ but I cannot find where to download the libraries from. Anyone know? ...

Accordion Menu - How do I know that it will slide up or down??

Hi I have a question I got an accordion menu(code below) and under the accordion menu I have a tag box. When accordion menu extends, I want to make my tag box go below the extended menu instead of extended menu covering up my tag box. So I change the value of css property "top" for my tag box after I count the # of sub-items being opene...

jQuery and Plugin Namespacing and Inheritance

Hey guys. There has been a lot of activity lately on the jQuery Dev Group about prototypal inheritance and plugin namespacing, and I want to see who has the best answer for it. Group link: http://groups.google.com/group/jquery-dev/browse_thread/thread/620c6a18a16d9665 Questions: What do you guys think should be done about this and why...

Javascript string separated by a comma

I'm trying to get everything before/after a comma from a string var test = 'hello,world'; Result: var one = 'hello'; var two = 'world'; What would be a good way to this? Thanks ...

JavaScript - Watch for object properties changes

I just read Mozilla's documentation for the watch() method. It looks very useful. However, I can't find something similar for Safari. Neither IE. Do you use this method? How do you manage portability across browsers? Thanks! ...

how do i click and load an altered ver. of mov. in same frame that it stopped when i 1st clicked?

how do i click and load an altered ver. of mov. in same frame that it stopped when i 1st clicked?. I want to duplicate the go arounds i see on chevy.com in the 360 mov. of their cars. then you change color and the car picks up at the same frame as where you stopped to change color. thanksd for the help ...

how to test if two elements are the same

I have a list of items that can be hidden/unhidden via JS be clicking them. The currently open item is stored in a variable, openActivity. Only one item can be opened at a time. I want to check in the click() event whether the clicked item is the same as the already opened item, so that it does not do a double-animation of it closing ...

Is there an opensource web based media player which can play all video formats,podcasts ,ppt slideshow and word doc presentation ?

Is there any open source, Flash- or Javascript-based media player which can play all video formats (like youtube) and pdf slide presentation (like scribd)? Is there any media player that can do both? Thanks in advance. ...

JavaScript delete or cancel

Hello, I'm trying to create a alert box which prompts user whether to delete or cancel, when I'm clicking on delete button it is working fine but when I click cancel again my webpage is closed. Below is the enclosed function. Please help. <SCRIPT language="JavaScript"> <!-- function go_there() { var where_to= confirm("Do you really ...