Consider the code below:
this.usedIds = 0;
this.SendData = function(data)
{
var id = this.usedIds;
this.usedIds++;
this.xmlHttpThing.open("POST", "/Upload.aspx", true);
this.xmlHttpThing.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
var currentObject = this;
this.xmlHttpThing.onreadyst...
Hello. I have developed an application in PHP + Javascript. I'm using MySQL as database support. Every account for this app will come with a subdomain... so the client Stardust would have stardust.mysite.com. I want to put the application files in a folder outside public_html and link every account from every subdomain created to this fi...
I need to do a quick and dirty 'Country' --> 'State' drop down relationship on a web form. I only am concerned with the states, provinces, and territories for USA and Canada, and this will be a relatively lightly used form, so a pure javascript solution is probably ideal.
...
Background
I would like to simulate the "active" behavior that most browsers support for links when they are clicked. For any element and event I would like to be able to add a css class to the element for the duration of the event. So in psuedo jQuery code I'd like to do this:
$(".button").click(function() { alert('clicked'); });
......
I recently was quickly shortening some method names in a javascript file and ran into a problem when I converted one method name:
Before:
RefreshSevenDayGrid(){
// some stuff
}
After:
7Day() {
// some stuff
}
I quickly discovered that the javascript no longer worked. I heard from several people that numbers should ne...
I've written C++ event-driven apps using MFC for GUI buttons, and I use HTML events like onmousedown to trigger some Javascript in a webpage. The idea of event-driven programming is intuitive when you are using the interface and events are hard-coded.
I know how to use a function pointer in C, and I see how Windows uses them to run an ...
I need to allow a user to click a link in "page-1.htm" and open a popup window. Then, when the user browses to "page-2.htm" in the main browser window I need to be able to reference the popup window.
JavaScript in "page-1.htm"
var playerWin = window.open("player.htm", "playerWin", "width=300,height=130");
playerWin.play("song.mp3"); ...
I would like to use this to hide/expand columns:
http://www.fiendish.demon.co.uk/html/javascript/hidetablecols.html
but remove eveything having to do with the form. The java script function must be changed accordingly but I am not having any luck. Any suggestions?
Thanks.
...
Within the gridview I have, I'm trying to make it so when the user checks a check box for the row the row is highlighted. Now, this GridView is striped (meaning even rows have one background color and odd rows have another). This code to do it is floating around the net in various forms...
var color = '';
function changeColor(obj) {
...
I've come across a couple questions, such as this one, and I really have to wonder why "Use jQuery" seems to be the answer when somebody asks how to do something in JavaScript. I understand that jQuery can save you a lot of time, and can help you out a lot, especially when you are doing a lot of fancy JavaScript in your site. However, ...
I've been struggling with this for the past couple hours now and I really don't know what could be wrong. I'm simply trying to get Javascript to communicate text with Flash. I found this great example with this source
http://blog.circlecube.com/wp-content/uploads/2008/02/ActionscriptJavascriptCommunication.zip
I ran the html file local...
I want every cell in each row except the last in each row. I tried:
$("table tr td:not(:last)")
but that seems to have given me every cell except the very last in the table. Not quite what I want.
I'm sure this is simple but I'm still wrapping my head around the selectors.
...
I have a multiview on my aspx page whose ActiveViewIndex I want to set using javascript.
for this I have used UpdatePanel inside which the MultiView control is placed.
I have enabled the EnablePageMethods="True" of the ScriptManager.
Whenever I am calling the Server Method I am getting "Object reference not set to an Instance of an Obje...
I'm trying to do something when a user selects an option from a select box - As simple as can be right? I'm using JQuery 1.3.1 to register a click handler with the id of the select box. Everything was fine until I tested using Chrome and Safari and found it didn't work.
Firefox 3.05 - YES
I.E 7.0.5730.13 - YES
IE6Eolas - YES
Sarafi 3...
Just curious:
4 instanceof Number => false
new Number(4) instanceof Number => true?
Why is this? Same with strings:
'some string' instanceof String returns false
new String('some string') instanceof String => true
String('some string') instanceof String also returns false
('some string').toString instanceof String also returns fa...
All I need is to be able to detect when text is dropped into a Textarea. I then take that text and do stuff with it and clear the textarea. There may be many of these textareas and very high UI expectations, so polling is a last resort.
For IE, "onfocus" does the trick, since this event is fired after the user drops stuff into the tex...
For simplicity, i have the following file named test.jsp:
<script language="javascript">
alert("a$b".replace(/\$/g,"k"));
</script>
I put this file in my local server, then display it using firefox: http://localhost:8080/myproj/test.jsp. It works okay, the result alert string is:
akb
But when i put this file in a remote serve...
How can I garble javascript code before sending it to client side. I don't want to expose functionalities. The code is already compressed using jsmin.
...
Example:
function pcs()
{
var t1=document.getElementById("tot1").value
var pb=document.getElementById("pcbox").value
var pc=""
if(t1==! && pb==!)
{
document.getElementId("rbox").innerHTML=""
}
}
My question is the of t1 and pb null means the function pcs() is not call... HOw?
...
Example:
function pcs()
{
var t1 = document.getElementById("tot1").value
var pb = document.getElementById("pcbox").value
var pc = ""
if (t1==! && pb==!)
{
document.getElementId("rbox").innerHTML = ""
}
}
My question is if t1 and pb are null the function pcs() is not called... Why?
...