javascript

How can I reliably capture screen resolution using Actionscript?

I have several components who's screen position depends on the resolution of the monitor on which the browser lives. loginBox.x = (flash.system.Capabilities.screenResolutionX - loginBox.width) / 2; loginBox.y = (flash.system.Capabilities.screenResolutionY - loginBox.height) / 2; The problem I'm encountering is that the flash.system.C...

Javascript resize page onload, can I do this before the page loads, classic asp

Hi, I am using the following javascript to resize an iframe. The top level page is written is classic asp and contains and iframe into which I am loading a control which is written in .net and ajax. The issue is, that the page size is dynamic depending on content, and also takes a while to load. What happens at the moment is that the...

Add text to text area using javacript.

How can I add custom text to already written text in textarea using javascript??Thanks... ...

iphone - IUWebView javascript scrollIntoView()

I have a simple UIWebView with simple HTML. At the end I place a javascript function: <script language='javascript' type='text/javascript'> var x = document.getElementById('SEARCHRESULT'); if (x != null) x.scrollIntoView(true);} </script> To force the view to scroll to a region. It doesn't seem to work. Does the UIWebView not support...

FCKeditor is leaving behind a lot of open tags - how to remove them

So I am using FCKeditor and the problem I am having is that when the user writes the document sometimes info is copied from Word, other times it is written directly in the editor and other times it could be done both ways. What this leaves me with in the DB is a lot of tags that are open and never closed. This is throwing my layout off...

jQuery autocomplete to get unused value

In my ASP.Net MVC application I have a jQuery autocomplete on a text box. I have everything working to display currently used item names and what I want to do is force the user to enter a completely NEW item name. I.e. the autocomplete acts as a guide to what exists but the user must ultimately enter a completely used string value. I wa...

Reset scale/width/zoom of Safari on iPhone using JavaScript/onorientationchange

I am displaying different content depending on how the user is holding his/her phone using the onorientationchange call in the body tag. This works great - I hide one div while making the other visible. The div in portrait mode looks great on first load. I use this to get the right scale/zoom: <meta name="viewport" content="width=devi...

Is there a way in javascript to obtain the definition of a given function as a string, to be possibly modified and evaled?

I am trying to evaluate a function in a new context, ie, one that contains a certain word defined that does not exist in the scope. It is easy enough if I have the definition of the function as a string, but I would like to provide the ability to do this with a regular list of functions, like so: var funcs = { first: function() { ret...

What's the most straightforward way to achieve a chainable JavaScript framework like jQuery?

I'd like to write a small JavaScript (framework) that can chain functions with all following functions being aware of the data of its predecessor. Basically, I'm not interested in the bloat (I realize it's small, for my even smaller project though it's bloat) that jQuery provides but would like to mimic some of its behavior -- primarily...

Autogrow jQuery Plugin on dynamic content in Internet Explorer

Hi I am using plugin here http://plugins.jquery.com/project/autogrow and I got a problem in Internet Explorer and Chrome (Not Firefox) See code below: <script type="text/javascript"> $(document).ready(function() { $('#main').html('<textarea class=\"test\">aaaa</textarea>'); $('.test').autogrow(); </script> </head> <bod...

JQuery wait for page to finish loading before starting the slideshow?

I have a site with a rotating header image (you've all seen them). I want to do the following: Load the entire page plus the first header image Start the header image slideshow transitioning every x seconds or when the next image has finished loading, whichever is later I haven't really need an example that truly does this. ...

Passing post data for windows.popup

A popup window is opened using window.popup Is it possible send post data to the popup page? I am working in tomcat + jsp ...

how to convert char to keycode

how can i convert a char to its respective keycode. ...

Has anyone used Sproutcore?

Has anyone used Sproutcore for a web application? If so, can you give me a description of your experience? I am currently considering it, but I have a few concerns. First, the documentation is bad/incomplete, and I'm afraid that I'll spend lots of time figuring things out or digging through source code. Also, I'm a bit hesitant to use a ...

How do I replace a character at a particular index in Javascript?

i'm having a string let say "Hello world" And i need to replace the char at ex:3 by specifying index hw can we replace a char. [JS] var str = "hello world"; i need something like str.replceAt(0,"h"); ...

traversing div's of the same class

Hi, i have 5 div's of the same class but different id stacking on top of each other. how do I traverse them using javascript? they are named div1, div2, div3, etc... also, how do i change each div's attribute while traversing? thank you very much. tam. ...

User.Identity.Name always empty in Firefox and Chrome

Hello guys, I have a problem using Form Authentication. When using IE everything is working fine using Form Authentication. But with firefox and chrome the value for User.Identity.Name and IsAuthenticated is always empty. The scenario is like this I have an ajax call to the controller ($.ajax.....) and in my controller I have their a f...

document.getElemenyById not working in one file but working in other

this function is running in one of my files but not working in other one, i have checked all the names etc but couldn't find..... in first file <script type="text/javascript" > function fillDataInCommand() { // var abc = document.myApp.getDataForCommand(); var abc ="heelo syed ammar hassan is here"; document.getEl...

not quotes in regex

i'm having a string var str = "hello -- (world)"; using regex and replace str.replace([a-z],"0"); replaces all the alphabets. but i need to replace other than alphabet. ...

Which ingame scripting language should I support?

The ingame script will control NPC/AI logic. If I were to implement ingame scripting feature which language should it support? JavaScript (builtin browser support) TCL (interpreter in java) Lua (popular) Squirrel CSI Other Keep in mind my implementation will run on multiple platforms like .net, flash, javascript and java. What...