I am trying to send an asp control (textbox) to a javascript function.
onblur="CalculateLossRatio(this.value,<%=txtLossRatioCurrentYear.ClientID%>)"
Is is the right way to do this.
I work in Javascript with integer numbers only (mainly adding numbers and shifting them). I wonder how big they can be without loosing any bits.
For example, how big X can be such that 1 << X will represent 2^X ?
Is there is way to compress JavaScript code?
e.g.
function test(){
// some code here
}
after compression it should be
function test(){//some code here}
Also, I need vise versa at the time of editing the code.
Is it possible to add messages to the built-in error console of Firefox from JavaScript code running in web pages?
I know that I there's Firebug, which provides a console object and its own error console, but I was looking for a quick fix earlier on and couldn't find anything.
I guess it might not be possible at all, to prevent malicious web pages from spamming the log?
I want to pass data to id
<script language="javascript" src="/foo.aspx?id=1"></script>
I have this code in a aspx page.
The data should be passed on load, before this code is being executed.
how can i do that?
Suppose we don't know how many slashes we could get in a string but we do not want any extra slashes. So if we get this string '/hello/world///////how/are/you//////////////' we should transform it to the form of '/hello/world/how/are/you/'. How to do it with the help of regular expressions in JavaScript?
Hello,
I have an HTML textarea element. I want to prevent a user from entering any HTML tags in this area. How do I detect if a user has entered any HTML a textarea with JavaScript?
Thank you
I am struggling with methods in JavaScript.
obj = function(){
this.getMail = function getMail (){
}
//Here I would like to run the get mail once but this.getMail() or getMail() wont work
}
var mail = new obj();
mail.getMail();
How do I make the method in a way that I can run it both inside the object and from the outside
Thanks
In Python I can use the iterkeys() method to iterate over the keys of a dictionary. For example:
mydict = {'a': [3,5,6,43,3,6,3,],
'b': [87,65,3,45,7,8],
'c': [34,57,8,9,9,2],}
for k in mydict.iterkeys():
print k
gives me:
a
c
b
How can I do something similar in Javascript?
I'm trying to find something like this: http://coffeescripter.com/code/ad-gallery/ that is controlled by an xml file that can simply contain the image location, thumbnail location and the text for title/description. Has to be pure jquery or javascript though - no flash based stuff.
I've found loads of great components but can't find one that is controlled by XML. Anyone happen to have seen one around anywhere please?
Hi
I have ArrayList in my Model and want to iterate through it in my javascript. I am using following code but its giving me error : CS0103: The name 'i' does not exist in the current context
for(var i=0; i <= <%=Model.KeyList.Count%>; i++)
{
alert('<%=Model.KeyList[i]%>');
}
How to get rid of this. its urgent...Please.
I have some third-party Javascript that has statements like this:
FOO = function() {
...functions() ...
return { hash }
}();
It is working as designed but I'm confused by it. Can anybody define what this structure is doing? Is it just a weird way to create a class?
Hi all,
I would like to know if it's possible to use javascript to open a popup window containing an image, and at the same time have the print dialog show. Once someone clicks on print, the popup closes.
Is this easily attainable?
I have a problem that I have been trying to figure out and haven't been able to get past it because Chrome/FireFox/IE do not publicly publish their "rules" for pop up blocking when it comes to JavaScript, Flash, etc. I am trying to trigger a window.open() when a user clicks anywhere on page. I've tried this:
document.onclick = window.open("http://msn.com");
But all 3 browsers are blocking the popup, even though it is a user interaction.
I have an aspx that has the following javascript function being ran during the onload event of the body.
<body onload="startClock();">
However, I'm setting the aspx up to use a master page, so the body tag doesn't exist in the aspx anymore. How do I go about registering the startClock function to run when the page is hit and still have it use a masterpage?
Hi,
I have a <div id="one">this is a sentence</div>
I have a textbox for userinput, if the user types a word which matches any word in div, eg: if user types "this", which is also there in div value, the background color of "this" should be changed, using Javascript
Thanks
Sunny.
I want to valid if user has entered username and password at the time of creating an account is safe or not based on its length(for my case five) on the right side of input field by showing that in different color i.e. for shorter in red, otherwise in green. How can I do that with javascript?
Hello, this is quite a simple question hopefully.
Our client currently has a Flash banner ad on their site which they can change the text size, colour, position etc. by editing an XML file. They want to scrap flash and use JavaScript and jQuery. Now, as long as the XML file is at a readable URL I should be able make an AJAX request for the file and use it. Is that correct?
Many thanks
Hi,
I wrote an ajax program.when i am getting response, at that time i will display
that content in my web page using html tags.
So how can I use html tags in javascript?
Is here a convenient way to quote a large block of HTML that has both single and double quotes in JavaScript? Is there anything like a HERE-doc <<EOF, a multi-quote character """, or custom delimiters q{}?
Any creative or inventive solutions to this problem?
How is it possible to make a input field editable in javascript. I mean onFocus putting it in insert mode so that values can be overwritten. Any suggestions ???
I need a javascript to replace i into I. This should apply to cases such as
i'm good.
So am i.
He though i love him.
The standard ThisContent = ThisContent.replace("i", "I"); doesn't work because it replaces every i. I also thought of ThisContent = ThisContent.replace(" i ", " I "); but it doesn't work for the first and second case.
Any idea?
So I have a textarea containing text. I want to be able to display a tooltip when my mouse is hovered a certain word inside the textarea.
Is this possible at all? I would prefer to see a solution that doesn't use any third party javascript libraries.
Thanks!
Do you know a framework for making presentations using only HTML5 and javascript technologies?
I'm not talking about "export" features of various presentation software (powerpoint or OOo presentation).
Some requirements for the presentations made with this "framework":
take advantage of the latest HTML5 features (audio, video, canvas?)
same with CSS3 (font support, gradient, shadows, transitions and transformations)
If there's no such thing, example of good presentations or pointers on the subject would be appreciated.