In my javascript code I have
onchange="document.getElementById('user_name').value = document.getElementById('theDomain').value + '\\' + document.getElementById('fake_user_name').value"
here backslash doesn't work. What is the problem?
How should I write it?
For example,
<html>
<body>
<img id="pic" src="original.jpg"/>
</body>
</html>
In Javascript (jQuery):
$("#pic").attr("src","newpic.jpg");
Now, is there a way to reset #pic's src to original.jpg without explicitly setting it as $("#pic").attr("src","original.jpg");?
Is there any way I can expose a C++ object/function to JavaScript running inside the QtWebKit browser in Qt? It's possible to expose ActionScript objects to JS code running inside the WebKit browser in Adobe AIR - I'm looking for similar functionality in Qt.
I'm trying to use the replace function in JavaScript and have a question.
strNewDdlVolCannRegion = strNewDdlVolCannRegion.replace(/_existing_0/gi, "existing" + "newCounter");
That works.
But I need to have the "0" be a variable.
I've tried:
_ + myVariable +/gi and also tried
_ + 'myVariable' + /gi
Could someone lend a hand with the syntax for this, please. Thank you.
How can i achieve http://jdstiles.com/java/angledtext2.html this kind of angle(slant) using html , css and javascript. In design we have tabular structrer and by clicking on a tab the area beneath should refresh without reloading page (some thing like jquery or ajax).
Good Day!
i am working on page which has
Javascript Menus (dont know how made, i think they are in compressed form)
Jquery
Sexy Alerts
now my problem is that when i want to add any type of jquery calender, it wont work :(, i have tried different possibilities found here, but yet invain. Can somebody guide me.
OR
some body give me suggestion to use a calender that is compatible with any other framework.
help is appreciated.
Thanks
I am wondering how to do a simple Javascript log in for my web pages on my dev server. I want it to be very simple, like the ones that pop up when you go to 192.168.1.1 to adjust the settings on your Linksys router.
Any suggestions?
I'm making a call to PayPal's credit card processor, and after a successful/unsuccessful transaction it returns me a string that looks like this:
DoDirectPayment failed: Array ( [TIMESTAMP] = 2010%2d05%2d02T23%3a33%3a28Z [CORRELATIONID] = 8c503f5c6c861 [ACK] = Failure [VERSION] = 51%2e0 [BUILD] = 1268624 [L_ERRORCODE0] = 10527 [L_SHORTMESSAGE0] = Invalid%20Data [L_LONGMESSAGE0] = This%20transaction%20cannot%20be%20processed%2e%20Please%20enter%20a%20valid%20credit%20card%20number%20and%20type%2e [L_SEVERITYCODE0] = Error [AMT] = 90%2e00 [CURRENCYCODE] = USD )
I'm not a javascript pro, but how exactly can I turn that into a parseable array?
Thank you!
Hello!
In my javascript i want to open URL in new window with this method:
var win = window.open(url...);
How can i check this, not to open the same window and lose all inputted data.
For example, if i opened "www.musite.com/addproduct" URL in new window, input data, leave my work place. then i click open window again, new window open and i lost all my data.
Hi
I need some code to zoom an image when i mouse over that image, i want to zoom that image.
Consider i have 10 images in y page, when i put mouse over in first image that image should zoom and when i mov to second second image should zoom like that...
how can i do this, need some javascript or jquery something like that.But not sure.how can i do this...
Please help me
I'm using a classical javascript prototypal inheritance, like this:
function Foo() {}
Naknek.prototype = {
//Do something
};
var Foo = window.Foo = new Foo();
I want to know how I can improve this and why I can't use this model:
var Foo = window.Foo = new function() {
};
Foo.prototype = {
//Do something
};
Why this code doesn't work? In my head this is more logical than the classical prototypal inheritance.
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.
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?
When I have a JavaScript array like this:
var member = {
"mother": {
"name" : "Mary",
"age" : "48"
},
"father": {
"name" : "Bill",
"age" : "50"
},
"brother": {
"name" : "Alex",
"age" : "28"
}
}
How to count objects in this array?!I mean how to get a counting result 3, because there're only 3 objects inside: mother, father, brother?!
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?
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 ?
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
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
Hi,
In my html, I have an html element with a mouseover event handler.
Can you please tell me if it is possible for me to invoke that event handler programmically in JavaScript?
Thank you.
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?