javascript

javascript load url in background

I remember a couple of years a go, I used an hack from somewhere to update link hits in the background. What I remember is that I had an onclick event on my links that triggered a javascript function which tried to load an image or something (this is the hack), but instead of an image (or whatever it was) you put in an url like 'mysite.c...

js force page into iframe - will google crawl it?

Helo all - thanks for stopping by. Basically my question is as follows: I have a script that reloads a blog page if its not in an iframe on my site. Will this interfere with search engines crawling the blog? My gut says that this script wont keep the blog from being crawled, but it will interfere with any resulting links generated by ...

how to change textbox background color through javascript?

my javascript- function validate_loginform(loginform) { var uid = loginform.uid.value; var pass = loginform.pass.value; if(uid == "") { color('uid'); return false; } if(pass == 0) { color('pass'); return false; } return true; } function color(traget) { var targetbox = document.getElementById(target...

Usage of an AGPL javascript library in proprietary software

My apologies in advance for not doing enough research in this area, but all answers so far I have found have been contradictory and / or too confusing for my current understanding of GPL / AGPL. If I wish to use an AGPL JavaScript library in a proprietary (not open source) product, am I essentially out of luck? Technically the source o...

how do I change the load sequence of external javascript

I have a web page that loads an external chat script, but the script loads before all my CSS and jQuery kick in, so my page looks all messed up for a few seconds. Need help figuring out how to launch my chat script once the page is done loading...I think it can be done by adding the script into my jQuery setup, but I'm not sure how to d...

Javascript mouse position problem

I am getting the screen coords of my mouse click using clientX and clientY in IE. I am using these coords to plot a point on an openlayers map however, the x axis is always perfect but the y axis is always exactly 86 pixels out. At the moment I am just getting round this by doing clientY - 86 but obviously this is no good as a long term ...

Repeat not consistent throughout months

By looking at the code I've provided below, does anyone know why the repeat is not consistent throughout each month? What I mean by this is for the first month that displays up until the end, the repeat works fine, then towards the end of the month onwards, the repeat is not displaying correctly. The output of the below code can be seen...

How can I have a JS script update a page for everyone viewing it?

I'm creating a web application that allows users to make changes through Javascript. There is not yet any AJAX involved, so those changes to the DOM are being made purely in the user's local browser. But how can I make those DOM changes occur in the browser of anyone else who is viewing that page at the time? I assume AJAX would be invo...

Access root domain's localStorage from subdomain

EDIT: For the sake of simplicity: I've got a simple UserJS script (FF/Chrome: Greasemonkey, Opera: built-in) that fixes some issues on website I'm using quite often. The problem is that I need to store some data between different requests. My first attempt was LocalStorage but it fail when it came to work with subdomains: www.domain.co...

Display only 10 characters of a long string?

How do I get a long text string (like a querystring) to display a maximum of 10 characters, using JQuery? Sorry guys I'm a novice at JavaScript & JQuery :S Any help would be greatly appreciated. ...

What's the best way to submit a form to a form script on another site?

I am working on a basic HTML page that requires the user to send details to a script located on a third-party website. What I require is for the user to fill out a form on my web page, and have that information submitted to another third-party form. I do not wish to return anything to the user, other than whether the submission was succ...

Using jQuery to get data from XMl

<?xml version="1.0" encoding="UTF-8" ?> <iMon_Reporting version="1.0"> <DATA>active server pages</DATA> <DATA>asp.net</DATA> <DATA>asp.net applications</DATA> <DATA>health service</DATA> <DATA>health service management groups</DATA> <DATA>logicaldisk</DATA> <DATA>memory</DATA> <DATA>network in...

ASP.NET AJAX Controls : UpdatePanel & UpdateProgress.

It seems UpdateProgress will be displayed covering the entire area of the UpdatePanel. I want to replicate this behavior using plain javascript, as this behavior needs to be done for a windows client form. Are there any javascript libraries available? Thanks. EDIT : I am using a Browser control inside windows client form to get resul...

Highlight each word on a webpage, one at a time, with JavaScript

What's the best way to visually highlight each word on the page, one at a time? I figure that the words should be broken up into an array and iterated over that way, but what's the best way to do so? I already know how to perform string replacements and style individual elements, the trick is to do this on each word on the page, one at ...

Perl CGI & JavaScript | Select Option troubles

I'm having a tough time trying to figure out why the following code isn't working: test.cgi: #!/usr/bin/perl -w use CGI; $cgi = new CGI; $cgi->autoEscape(undef); %ptype = ("0","","1","Pennsylvania","2","New York","3","Ohio"); print $cgi->header('text/html'), $cgi->start_html(-title=>'Test',-script=>[{-type=>'javascr...

Try/Catch for Javascript in mobile safari?

Can I wrap a try/catch around the opening of a URL in mobile safari? I know the question has been asked a number of different ways but essentially what I'm after is the trapping of bad URLs or the detection of when a specific URL cannot be opened by the browser. ...

To call C# Function from Javascript in Web apps

Hi i wanted to call a C# function through javascript code. For Eg: i have C# function which is in aspx.cs page public void setValue() { lblMsg.Text = "hello"; .... ..... } from javascript i need to call this function. ...

Execute ClientSide before ServerSide in ASP.NET

I am using ASP.NET 3.5. When the user click on say btnSubmit I want to first execute some JavaScript code and then execute some C#/VB.NET code. Is this possible? If so how would one do it? Thanks in advanced! ...

Binding anonymous functions all over the place.

I generally write code that looks like this (but with many more handlers). $(document).ready(function() { $("#next").click(function() { doStuff(); }); $("#prev").click(function() { doSomeOtherStuff(); }); $("#link").hover(function() { doSomeTotallyOtherStuff(); }); }); Is this the bes...

JavaScript alert() advancing system time by 12ms

Here's a strange one: I was working on synchronizing a JavaScript timer with a remote server and noticed my timer (based on the Date() object) was gaining about 12ms relative to my remote server on each page refresh. I narrowed it down to the JavaScript alert() function. I created the following test and verified with 2 synchronized clo...