how can be a collection of global and/or local varibles be obtained in javascript?
(like e.g. in Python by globals() or locals())
if there is no such functionality available in javascript, how do some javascript console interfaces obtain them, to be able to autocomplete?
...
I am creating an HTML contact form that uses a standard image for a submit button.
Here is the html:
<form action="#">
<fieldset>
<input type="text" name="name" value="FULL NAME" onfocus="if (this.value=='FULL NAME') this.value='';"/>
<input type="text" name="" value="PHONE NUMBER" onfocus="if (this.value=='PHONE NU...
I'm a Java developer. To be honest, I'm a little intimidated about writing lots of javascript, so the idea of writing a web app completely in Java with GWT appeals to me!
I'm planning a new web app and one of my considerations is that I want it to run well on mobile browsers (for android and iphone). I've also used a few GWT apps that ...
I've got a list of links, all in the same class, each with a custom argument ("switch-text"). My script should copy the text of the custom argument to the text of each link and replace it ("Pick A" should become "Pick A Please").
It works fine with only 1 link, but when I add several, they all get switched to the first argument. ("Pick ...
hi there
I am doing an ajax request to a php page ('test.php')
inside of test.php is
<script type="text/javascript">
function test() {
alert('test');
}
</script>
<div id="abc">some normal content too</div>
now this function is unique to each page load, i.e it is generated via php to do different things
so, my question is how do i ...
Hello,
I have ajax domain lookup script.
Look here for DEMO:
Here is JS code for Ajax form Textarea1
<script type="text/javascript">
//Specify the time to wait before checking
var intervalToCheckForChange = 250; // in milliseconds, 300 = 0.3sec
var request;
var statusDivJS;
var isAvailableDivJS;
var domainInput;
var domainsAvailabl...
Is there a equivalent of jQuery live function inside prototype? I have a iframe which is dynamically loaded into dom, and I need to access elements inside iframe and I can't. I need to do something when certain element inside iframe is hovered, how can I do that with prototype or native js?
...
Hi,
I have following html:
<div class="rows">
<div class="row"><input type="text" onchange="javascript:getIndex(this);" value="" /></div>
<div class="row"><input type="text" onchange="javascript:getIndex(this);" value="" /></div>
<div class="row"><input type="text" onchange="javascript:getIndex(this);" value="" /></div>
</div>
...
Hi,
How can I use strings as the 'find' in a JS regex?
i.e.:
var find = ["a", "b", "c"];
var string = "abcdefghijkl";
Now, I want to replace all the elements of the array find, with a blank string ( " " ), using regular expressions. How can I do this?
I mean, using .replace(/find[i]/g, "") in a loop wouldn't work.
So, how can I do...
Using the JDK 6 ScriptEngine mechanism, anything that goes wrong during an "eval" or "invokeMethod" or whatever results in a ScriptException being thrown back to the invoking Java environment. As far as I've been able to tell by experimentation and source code reading, the best I can do to get information back from Javascript when my Ja...
Is there any reason why I shouldn't do something like the following (to avoid using a hidden field to store the temporary information)? I'm using jQuery syntax for brevity but it's a general JavaScript question.
function editComments() {
window.currentComments = $('#commentsTextBox').val();
$('#commentsTextBox').removeAttr("read...
I have a Ext.form.CheckboxGroup with multiple items of Ext.form.Checkbox.
Is it possible to cycle through each item of the Ext.form.CheckboxGroup?
I have tried the following to no avail:
for ( var i in Ext.getCmp('product_category_group').items.items) {
console.log(i.getId());
}
Any advice appreciated, thanks.
...
hi I have asp.net application. I'm using external javascript files in my application. When I test my site with page speed tool from google it says that following resources are missing a cache expiration. also some of the images and css files.
Can you give me please some examples how to set it and where exactly I need to set it.
...
Hi, not the best with Javascript so thought i'd ask where i'm going wrong.
as the title suggests, I have a select box with 4 different options, when an option is selected I want to change the contents of a <p> tag with id of pricedesc. Here is what I have so far.
function priceText(sel)
{
var listingType = document.getElementById('...
Hey, I'm in WebKit setting my own script delegate using setScriptDebugDelegate. I'm trying to figure out what code is being parsed by the javascript interpreter in the willExecuteStatement function.
How do I figure out what statement is being executed?
Function prototype..
- (void)webView:(WebView *)webView willExecuteStatement:(id)fra...
i have a section of a webpage that loads a javascript file from an external source and then kicks off an ajax query.
when i load the page, i see the browser saying "waiting for xxx.com" alot so i think the dependency on this external javascript is slowing my initial page load.
is there a way i can load this external javascript async so...
How do i create a multiline input with vertical scrollbars in EXTJS?
I used this
noteField = new Ext.form.TextField({
emptyText: 'note...',
multiline: true,
applyTo: 'txtNote',
maxLength: 250
});
noteField.setSize(200, 100);
but the input is not...
Hi,
currently I am trying to highlight elements on a page. Therefore I pass a comma seperate String to a Javascript-Funktion called highlight.
highlight("main:box1,main:box2");
This was working fine till I found ids with : on the page. So I tried to escape them with a little regex. Here things started to get a little funny.
If I esc...
As the title, I need something along the lines of...
using (Ajax.BeginForm("MyAction",
new AjaxOptions {
OnComplete = "function() { mySucessFunction(this); }"
}))
<script>
function mySucessFunction(srcElem) {
alert(srcElem.id);
}
</script>
An...
Hello,
In my application, I need to calculate the size of the file in client side (before uploading to server).
I want to restrict the file being uploaded if it doesn't satisfy my requirements like file size, file type..
Is it possible to achieve this in client side using JavaScript ?
Thanks for reading !!
Have a Good Day.
...