I know that some people consider the presence of a leading underscore to imply that a variable is "private," that such privacy is a fiction, and assume this is why JSLint reports such names with an error message.
I use Google Analytics on a Web site I am building. I make reference to GA's variables, such as "_gaq."
I am trying to get m...
Is there any reason to NOT have a webpage retrieve it's main content on the fly?
For example, I have a page that has a header and a footer, and in the middle of this page is an empty div. When you click on one of the buttons in the header, an http GET is done behind the scenes and the .innerHTML() of the empty div is replaced with th...
Hello,
What's the cleanest way, like 1 line of JavaScript code, to set one text box's text property to equal another?
e.g. the JavaScript way to accomplish this:
txtShipCity.Text = txtCity.Text;
Thanks!
...
How register (call) jQuery function from asp.net usercontrol from codebehind file?
...
I have a div element with some formatted images. On user request, I load additional images asynchronously, without postback, and append the result (formatted HTML for new images) to the div element using JavaScript:
function onRequestComplete(result) {
var images = document.getElementById('images');
images.InnerHtml += r...
I'm trying to get my Javascript code 100% JSLint clean.
I've got some JS code that I've lifted from elsewhere to create a UUID. That code has the following line:
s[16] = hexDigits.substr((s[16] & 0x3) | 0x8, 1);
This line incites JSLint to generate two error messages:
1) Unexpected use of '&'
2) Unexpected use of '|'
I don't under...
on This page in the center is a button that says "request price". I am using Colorbox so that when you click it, there is a lightbox-type popup of a Flash app.
This works fine in FF and Chrome. However in IE it is just taking you directly to the page containing the flash rather then making it a popup.
Does anyone have a clue why?
...
How do you nest quotes in HTML beyond the second level? As far as I know, there are only 2 types of quotes - single(') and double("). I am aware of escaping using slashes - you have to escape in the code but that escaping won't work at the browser level. What is the accepted method to get around something like the following?
<p onc...
Of all the conventions out there for positioning braces in C++, C#, Java, etc., I don't think I've ever seen anyone try to propose something like this:
public void SomeMethod(int someInput, string someOtherInput) {
if (someInput > 5) {
var addedNumber = someInput + 5;
var subtractedNumber = someInput - 5; }
else ...
Hello,
i'm using mootools.js, i have this code:
this.html.chat_title = new Element('span', {
'id' : 'chat_title',
html : 'this is the title'
}).inject(this.html.container);
The problem is:
span id="chat_title" html="this is the title"
as you see it doesn't put the text inside the HTML of the tag but as an attribute.
What i...
Hi, is there a way to measurement system using javascript/JQuery? I need to display some distance and speed values on the page, but It looks like that there is no such function call I can get this information.
...
function FM_log(level, text) {
// caso não seja log total escolhe o que loga
var log = false;
switch (level) {
case "addtoprio()":log = true;
case "alternaTropas()":log = false;
case "sendtroops()":log = false;
defalt: log = false;
}
if ((logTotal == false) && (log == true))
G...
Hi
If i have the following code in my html file
<div id=div1>
<script type="text/javascript">
externalFunction();
</script>
Is it possible to get the id of the div in the method externalFunction()?
Regards
Damien
...
I have a web page made of three frames, something like this:
+----------------+
| 0 |
+-------+--------+
| | |
| 1 | 2 |
| | |
+-------+--------+
Frames 1 and 2 are for comparing some similar data. I'd like to sync the vertical scrollbars on these frames (setting the scroll bar value on...
I have a plugin that access the length property on many elements. However, the javascript console points to line 12 of jquery.min.js.
How can I backtrace to find which line of my plugin has null variable attempting to access length?
...
I've got a page with a Timer that is being used as a trigger on an UpdatePanel. The page also contains a TabContainer and several TabPanels. Look at this question for more information. Basically, I've got an UpdatePanel as the element in each TabPanel's ContentTemplate, and the UpdatePanel is triggered by the Timer.
My page displays dat...
How can escape quotes for use in HTML? My line of code is:
<body onload="setTimeout('window.location='http://somepage.com'', 1000)">
As you can see in the current example, there are two ', and a " being used. How can I escape them for the above to work?
The onload contents are set dynamically for a system I am working on @ work.
...
I am pretty new at this stuff, so bear with me.
I am using ASP.NET MVC.
I have created an overlay to cover the page when someone clicks a button corresponding to a certain database entry. Because of this, ALL of my code for this functionality is in a .js file contained within my project.
What I need to do is pull the info correspondin...
I am trying to take form results that are generated from a PHP call and populate them into a div that will then appear in a light box upon click of the submit button. So far I have successfully setup the form and am populating the results on the same page into a hidden div. I can make this div appear no problem in a light box by settin...
My javascript code is calling a asp.net webservice, so i have a call to the webservice something like this:
MyWebservice.GetData(param, ResponseReceived, ResponseTimeOut, ResponseError);
When the webservice returns data, ResponseReceived method is called.
However sometimes the user might navigate to another url before the webservice c...