javascript

Using JSON with jRails

I am currently trying to use AJAX in my application via jRails. I am trying to return a JSON object from my controller, and then parse it in my Javascript. I am using json2.js to do the parsing. Here is the code I currently have: function getSomething() { $.ajax({ type: "GET", url: "map/testjson", success: ...

login problem with ajax

i have created login page which sends ajax request to a php page for login verification. On that php page i m creating session, and sending response as per login verification. if user is authenticated i m redirecting it to home page from java script from where i send ajax. but on that homepage i cant get that session object... why? can u...

file write or read in JavaScript

how can I write and read files in JavaScript? Is it possible? ...

Cloning an element and adding it to Dom multiple times

//I am cloning a dom element and inserting it in dom element multiple times <div class='toBeCloned'>some text</div> <div id='target'></div> var _clone=$('.toBeCloned').clone(true);//create clone var _target=$('#target'); //this is target _target.append(_clone); //append target _target.append(_clone); //append t...

Is is possible to apply 2 font filters in SIFR?

Hello, is it possible to apply 2 font filters that are of the same type but with different parameters in SIFR? I want to get an outline effect around my fonts and tried to apply 2 glow filters with different settings to get the desirable look, but it looks like only 1 filter (last in the list of filters) is applied. Does anyone know if ...

Are there any reasons for why you would include JavaScript using document.writeln

Are there any good reasons for why you would include JavaScript like this: <script type="text/javascript">document.writeln('<script src="http://example.com/javascript/MyJavaScript.js" type="text/javascript"><' + '/script>');</script> (Sorry for the long scrolling line. This is in the head of a HTML document.) I've been looking at som...

Javascript digital signatures

To create a digital signature with the client certificate in javascript, there was a function: crypto.signtext() that doesn't work anymore What is the easiest way to do this now? ...

Pass HTML-DOM to Flex's actionscript.

Hi, All i want is to pass a HTML (DOM object) from javascript to Actionscript. i saw this article on the net and tried a similar code. But when i execute the code in IE, it alerts : "Out of memory at line 18". I'm stuck here from yesterday. i'll post the mxml and html here.. The MXML : <?xml version="1.0" encoding="utf-8"?> <mx:...

Preventing New line in a multiline text box

Hi, How to prevent the new line character at the beginning of the text entering in a multiline text box? Now, I already trimmed the white space at the beginning of the text. but i can't prevent the new line character that has to be occurred by entering the enter key on the most beginning of the text box. Please help me. thanks in advanc...

IE's responseXML.getElementsByTagName() unable to handle non English character ?

I have a javascript that does this (http is your XMLHttpRequest object) var r = http.responseXML.getElementsByTagName('item'); The issue is variable r is always an empty list if the response contains non-English character (r.length is 0). The response header is correctly set Content-Type: text/xml;charset=ISO-8859-1 This is what the...

Divs over images using JavaScript

Say I have an image with a couple of dots in a web page. When someone clicks on the dots I want a JavaScript function to be executed and then a div placed over the clicked dot in the image. Something akin to markers in maps. How do I go about doing this? ...

How to refresh a parent page #Rails

Hi Guys, I have the fllowing requirement, I have a model called Task to display user tasks 1 . Link to add a new task (in the tasks index page) 2 . when a user click the link, 'tasks/new' action will open up inside a popup 3 . when the user save the new task, I want to close 'new task' popup and refresh the parent page 'tasks/index...

SoundManager2 has irregular latency

I'm playing some notes at regular intervals. Each one is delayed by a random number of milliseconds, creating a jarring irregular effect. How do I fix it? Note: I'm OK with some latency, just as long as it's consistent. Answers of the type "implement your own small SoundManager2 replacement, optimized for timing-sensitive playback" are...

Why wont this JS code work if its all on the same line?

I'm writing HTML code for a java servlet. i first write the code in html/js so i can debug what im working on, and then ill make it a java string and put it in my servlet. My problem is that the code is working fine when i view it in ff from a local html file, but when i view it on my java servlet, it doesnt work because the js isnt ge...

How to reload ASP 1.0 page with additional parameter

Hi, I'm a beginner of ASP. I'm maintaining at ASP 1.0 page and I want to reload the page with an additional parameter when user click client-side URL. Its important that it also keeps the current parameters. The objective is to export the table currently display in Excel. So I want to reload the page with a special parameter that w...

Confirm box before closing a tab

I want to have a confirm box when user tries to close the window. window.onbeforeunload = function (evt) { var message = 'Are you sure you want to leave, cause there are some unsaved changes?'; if (typeof evt == 'undefined') { evt = window.event; } if (evt ) { evt.returnValue = message; } return message; } The thing is i wa...

Relative width for a CSS layout, fixed and fluid mix

Hello, I am trying to make a chatroom layout like the following: Now my problem is that I am not sure how to have the container box occupy the whole width and height (with valid doctype) and then make the center div grow if the window grows keeping the rest constant. i am well aware of js/css. so i just need some beginning guideline...

javascript form validation - positioning

Dear Masters! I have little snippet for validatin' my form. I need help to position the error messages, because now all message appear in the filed, so the user can't see it, and so its very annoying. $(document).ready(function() { jQuery.validator.addMethod("lettersonly", function(value, element) { return this.optional(element...

has google-maps a unable-Drawing method when i Drawing via enableDrawing method..

i do this that can drawing when click: polyline.enableDrawing(); and my program is : how can i unable it(when i click a div element) thanks ...

how to delete a marker on google-maps..

i think it has two ways : 1.right click and select the 'delete me' 2.has any other way ??? so how does enable the right-click on google-maps,and then delete the marker. thanks GEvent.addListener(marker, 'mousedown', function(e) { alert(e) if (e.button == 2){ alert('sss') map.removeOverlay(marker); } and whe...