javascript

JSON htmlentities javascript

Hi! I am using an XMLHttpRequest to POST a JSON string to PHP. The JSON object is created in JavaScript and using the JSON2.js from json.org to create an JSON string representing the object. JSON.stringify(object); Whenever the object contains a string which has a special character in it, e.g. é, JavaScript does not give any error but...

QuickTime movie disappearing from Javascript when scrolled offscreen in non-Safari Mac browsers?

I have a web page I'm creating that uses Javascript to control an embedded QuickTime player. I add the QuickTime movie to the page using the AC_QuickTime.js file from Apple (as described here - http://developer.apple.com/mac/library/documentation/QuickTime/Conceptual/QTScripting_HTML/QTScripting_HTML_Document/ScriptingHTML.html#//apple_r...

Safari Javascript parent.frames.length

I get a parse error from Safari with this code: for (var i=0; i<parent.frames.length; i++){...} doing alert(parent.frames.length); works and outputs the correct value which is 5. I also tried but failed: var len = parent.frames.length alert(len); //Correct for (var i=0; i<len; i++){...} //Parse Error When i type this code into ...

How to create a dynamic key to be added to a javascript object variable.

I'm trying something like this, but this example does not work. jsObj = {}; for (var i = 1; i <= 10; i++) { jsObj{'key' + i} = 'example ' + 1; } What can I do to make a dynamic key like this? Thanks, Ryan ...

Which datepicker does EveryBlock utilize?

I've found a great datepicker on EveryBlock's web site: http://ui-patterns.com/userset/553/image/2955#focus Does anybody know which control do they use and is it available as a standalone control? ...

Use VIM omnicomplete for javascript with ctags

I am using vim/gvim for 4 months already and now I found a way to use it's strengths. My tags file is generated very well and here is a simple row in it. my.namespace.classname /path/to/file.js /^my.namespace.classname = function(first_arg,$/;" f Here is an example what i need to omnicomplete: my.namespace.cla <- omnicomplete list...

is jsobject eval method of java is same as eval method of javascript

Hello, I have read so many times on these and other forums that you should not use eval() in JS. I am writing outputs from java applet to the browser, using JSObject eval method in import netscape.javascript.*;, its working fine in FF but on IE I am getting the Unspecified errors, if I lighten up the DOM by removing menus etc, thi...

Disable a checkbox in javascript and recognize it as checked on the server side

I have a checkbox which in some cases may be disabled and checked using javascript, i.e: var cbTest = document.getElementById("CheckBoxTest"); cbTest.disabled = true; cbTest.checked = true; However, when sending a postback, CheckBoxTest.Checked is false on the server side. Is it possible to disable the checkbox and still have the ser...

How do I register a Javascript function to run with every postback?

I have a treeview in a user control. I need to run a javascript function with every asynch postback to scroll the div it's in to the right position. I've got it working, but I think there has to be a "cleaner" way to do it. In the Page_Load function of the control, I have the following code. Is there a better way to do it? ScriptMan...

Javascript content rotator?

I’ve got the basics of a content rotator done, the only problem is it doesn’t loop itself back to the beginning and I cannot figure out why! It is a very simple javascript script: window.onload = function() { setInterval("transition()", 5000); } function transition() { var y = document.getElementById("featured").getElem...

IE font size decrease does not cause select box height to decrease

I have a font resize function on my page which increases the font size via javascript for the entire page. This works fine in most browsers except IE. When decreasing the font size after increasing it, the select boxes new height does not decrease, even though the font size is decreasing on it. Instead the smaller font appears to be p...

Editing SVG styles from javascript

I have an SVG map of the world, and I want to colour each region by various metrics in real time by altering style attributes for each region in the svg. EG I want to tint the UK blue to reflect the upcoming tory victory (ahem). This needs to be dynamic as the data changes often and is pushed out to the browser. ...

How to test web layout using javascript testing frameworks

Has any one tried testing the actual layout of the web application in different browsers? I can only think of getting the actual dimensions of all the elements and then matching it with expected values. I think it is crude way to do it. Is there a better way to actually test the layout? Thanks Bharani ...

javascript ajax variable question..

Hey there, new to AJAX, JS.. Im trying to add to a Javascript/Ajax search script that I've put together. Previously, it had a single search field, called search_word, I added one called search_date. $(".search_button").click(function() { var search_word = $("#search_box").val(); var search_date = $("#datepicker").val(); var ...

Run a javascript function on script load

I am using jQuery. I keep all of my function definitions wrapped in the $(document).ready event in application.js. I have a function from it that I would like to call somewhere in the body of the page I am working on. I was wondering if there is some alternative to the .ready event that will work on a script load. Ideally I would l...

onMouseOver not working fine with hover

Hi, i'm trying to get a popup window when hovering a div by calling the following function onMouseOver function PopUp(h) { $('#task_' + h).hover(function (evt) { var html1 = '<div id="box">'; html1 += '<h4>Taskbar ' + h + ' ännu en test - fredagstest </h4>'; //html += '<img src="Pictures/DesertMini.jpg" alt="...

jquery full calendar

hello everybody. I am new to fullCalendar and i do not kno how to use gotoDate method. What i have is a tabbed page with 12 tabs (every tab is a month of the year). What i need is when i load jquery calendar, foreach tab, the calendar to switch to the month that is assigned. (e.g when i click and load page for January the calendar shows...

Ext JS Grid IE8 doesn't show any data until select

Hi, I'm creating a table editor using the grid widget of EXT js. Now this is working quiet good in FF but when i'm using it in IE8 it doesn't show any data until i select one of the rows from the grid. When you look at the grid when loading, it shows the data and then it disappears. After that you can only get the data back by selecting...

cross-browser text (blur) shadow..

How to get cross-browser text (blur) shadow? including IE6, 7, 8. is there any css or js solution? I want to get text-shadow with semantic and valid markup. ...

Jquery Css Selector Add Value

How can i reset a display:none and add some value here is the code onclick="$('reason{$test->id}').css('display:block'); $('#reasonid{$test->id}').val(this.value);" ...