javascript

Javascript history.back() not working in rails app

Hey I'm calling history.back() on the on-click of a 'back' button in a rails app. But nothing happens. There is history in the browser -- pressing the browser's back button takes me back to the correct page. If I use history.go(-2) however, the page goes back correctly. So why do I have to tell javascript to go back two pages instead of...

Restrictions of GPL on javascript libraries

If I use GPL-licensed JavaScript components on my website, would it be considered as a release to the public (as client-side code of the components is loaded to users' browsers via http) and I have to "open-source" the whole website? So, can we say that the usage of JavaScript components on a website is distribution of the code and it...

Javascript: collect info from multiple function onload events until web page finishes loading

Okay, now I've got this thing I need to do with Javascript but I have no idea the best way of doing it! I'll explain by telling you how I "think" it should work... Inside the web page there will be multiple span tag like this: <span onload="myfunction(1);"></span> myfunction() (hosted externally) will wait until the page finishes load...

Internet Explorer and <select> tag problem

I am having the following problem under Internet Explorer 7/8: I have a popup that gets activated when user mouseover a link. The popup is a simple <div> that contains some data. Inside this <div> tag there is a <select> tag with some <option>s. I have attached mouseover/mouseout events to the <div>, so that this popup will stay open wh...

how do i have dynamic confirmation popup using simple modal

I am using simple model which is a very neat piece of code but i have one requirement i can't figure out. http://www.ericmmartin.com/simplemodal/ my use case is the third options where i want a "Confirmation Popup" after a user clicks on an action. The issue is that in the example the message is hardcoded in the js file. i need to be...

How to Print a Javascript Variable in a Table?

Hello all, In a table I'm making I have a Radio Button variable named 'cost' and I want to print the 'cost' variable in the footer of the form in a sentence like 'Make the check out for <>' Please, can someone give be some guidance as to how to do it? Many many thanks, TEH <table id="gradient-style" summary="Throttle Conversion"> ...

IMacro Scripting - How to read a local .txt file using javascript

Hi There is this IMacro scripting tool, if you want to automate some web page visits by using javascript. I would like to have my javascript to read from a local .txt file (not a .cvs file and not well formatted.. I would like to search in it probably with a regular expression..) and based on that reading, the script will do some j...

IE, Javascript and Reflow

Hello, I have a javascript function that changes the css display ('block', 'none') of a large number of dom nodes (>5000). I am trying to make this as fast as possible. Will IE interrupt javascript to reflow and paint the screen, or will it wait until the javascript engine returns control to the browser? I want to avoid any extra wor...

Real Time Online Voting Without Leaving Page?

Possible Duplicate: Stack Overflow / reddit voting system in php How do voting systems, like the one here at SO, work? I would like to implement a voting system on my web page (coded in php), but dont want to have to force the user to post a form to vote and update the database. I would like it so when a user clicks a thumbs up,...

Relative Positioning Div

I've created a div and add 2 divs to it: <div id="content"> <div id="a"></div> <div id="b"></div> </div> and the styles: #content { width:100px; height:100px; background-color:blue; } #a, #b { position:relative; top:0px; left:0px; width:100px; height:100px; background-color:red; } #b { top:-100...

Google maps not being interactive

Hey, I just started using Google maps, and am having a problem. Adding overlays is working fine. If I add controls (zoom, left/right etc.), they are also working fine. But Googlemaps isn't allowing me to drag, even if I set map.enableDragging(). It also won't respond to any of my GEvent.addListeners. I've looked on other sites, and ...

How do I strip bad chars from a string in JS?

My JS saves some string data to JSON using "stringify()", but observing the outputted JSON string I see a lot of strange chars (out of keyspace), such as NULLs and other bad chars. Now I don't have a list of these "bad" chars so how can I strip them out of my string data? ...

Set a js variable in a html include

I have a ASP.NET page that uses the include method for header. I am adding a JS variable that I access from JS functions In head.htm <script language="javascript" type="text/javascript"> var render=<%= RenderProperty %>; </script> The RenderProperty is a method in the base page class (a .cs file that inherits from System.Web.UI.P...

How to hide/show select boxes depending on other choosed select box option?

Hi. Im a newbie in javascript and i really aprecciate any ideas of how i can do this... I have one select box. Depending on the option i choose, the other select boxes that are supposed to be "invisible" one of them becomes visible. I dont want to use jquery, because im still a newbie in js. Sorry for my english :P I will put some c...

Reading bytes from JavaScript string

I have a string containing binary data in JS. Now I want to read, for example, an integer from it. So I get the first 4 characters, use charCodeAt, do some shifting etc. to get an integer. Problem is that strings in JS are UTF-16 (instead of ASCII) and charCodeAt often returns values higher than 256. The Mozilla reference states that ...

Can one use Ajax on Google App Engine as a logged in user over https from a non-appspot.com domain?

Suppose: You have a website http://www.example.com that redirects to a project on Google App Engine (i.e. example.appspot.com); you want communications to pass between the user over SSL (i.e. https://example.appspot.com); and You want the domain to be shown to the user to be *://www.example.com (i.e. not https://example.appspot.com). ...

Placing an empty div between jqGrid's Caption and The grid itself

I want to put some custom items (filters inputs) between the Caption and the grid itself on the jqGrid. Is this possible, I have searched the api and nothing jumped out at me that would enable this. For now, I have simply removed the caption and just put an all the stuff I want above the grid (including an H2 for what I wanted the capt...

What would be a nice modal box for an ASP Website?

I'm trying to implement a modal box in my ASP Website using Moodal: This link is flagged as a potential threat by Firefox. Follow at your own risk: http://www.e-magine.ro/web-dev-and-design/36/moodalbox/ There seems to be a problem because the window just doesn't show. I'm sure I've include all the headers. I don't know what else t...

Is this the "correct" solution for getting ASP.NET MVC and javascript intellisense to play nice?

Due to how paths relate to VS resolving the path to a JS file and then how the actual path at runtime is resolved via the browser, I've currently got the following placed at the top of my Master Page within my application so that all my views have the appropriate JS intellisense and resolve correctly for execution: <% if (false) { %> ...

Display of JavaScript files totally bolixed in Visual Studio 2008

I've recently had Visual Studio Team System 2008 installed on my work system, and I can't use it to view (much less edit or debug) javascript files. If it opens the file at all--about 30% of the time--it's frequently cut off at the bottom. Additionally, the display format is awful, not at all what it's supposed to be set up to be. Tiny ...