Hi
Below is the JavaScript code I use in my HTML page
<script type="text/javascript">
function loadXMLDoc(HTTP)
{
var xmlHttp;
try {
xmlHttp=new XMLHttpRequest();
} catch (e) {
try {
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
...
Hi, I have a programme in which I have written three functions, difference (that calculates the difference in numbers between arrays) sum (that totals the array up) and calculate difference which uses the difference function to determine what the next array should be).
All these functions are working but I'm having problems getting the...
I have got a piece of code, that should countdown some number (in this example 1111) and write it into span id="timeframe". But it doesn't work, i dont know why. Can you tell me where is my mistake, please?
<script language="JavaScript">
<!--
var txt_minute = "Min";
var txt_second = "s";
var time_left = 1111;
var temp=timel...
hi,
I need to build a dynamic multiple columns view for the content of my website (I'm using drupal as CMS, if can be useful info), with the following features
1) the columns width is fixed (OK)
2) the columns number depends on the window width (OK)
3) the elements has not fixed height (important, not fixed yet)
4) the content shoul...
Hi, is it posible to replace a character at a specific position within a textarea or textbox? I can work out the position using indexOf() but knowing this how can i actually replace that particular character?
...
Hi.
I wrote an autocompletion script for an input field on a website. It uses jQuery and works fine. It should look something like this:
Unfortunately, Firefox's own autocompletion gets in my way, overlapping some of the results:
Is is it possible to prevent the Firefox autocompletion field from popping up? (Not only on my machine ...
My Javascript needs to send some data to a server when the page closes, which I currently do with a synchronous AJAX (SJAX?) request in window.onbeforeunload. The problem with this, of course, is that if my server takes too long or the network connection dies, the browser freezes.
From what I've read, it's not possible to specify a time...
I have a long log file I am displaying with PHP. Its getting too long for me and I have to use CTRL+F to look at this thing in any way. What is a good way to display this data in a way easy to read?
Best way would be using jquery.
...
Im having an issue with the request below, for some reason I can seem to get the XML to display?
I've checked the URL and it displays fine, so im wondering whats going on?! Could anyone give me a hand? There should be something in the ResponseText not "NULL".
var url = "https://services.lexel.co.uk/paf/";
loadXMLDoc(url)
function lo...
Hi,
I use paperclip to add a file to my model.
I want to use the new feature of firefox 3.6, xhr.sendAsBinary, to send a file with an ajax request.
Here is how I build my request :
var xhr = new XMLHttpRequest();
xhr.open("POST", "/photos?authenticity_token=" + token
+ "&photo[name]=" + img.name
...
I imagine its a bit of javascript but how do you have the ShareThis widget go straight to the email page like on Mashable?
...
I'm trying to alert() the properties of the javascript object. Since the text in alert isn't scrollable, I can see only part of it. How do I fix this? I'm using FF 3.5.
...
Hi All,
I have an existing HTML table, part of a form where the user enters GPS points. The user also has the option to upload GPS data points. I'd like to have a button the user can press where some Javascript will add one or more new rows to the table, but the new row(s) must continue incrementing the name and id values used in the ...
Hi all,
I do not want to use Switch in my code, so I'm looking for some alternative
Example with Switch:
function write(what) {
switch(what) {
case 'Blue':
alert ('Blue');
break;
...
case 'Red':
alert ('Red');
break;
}
}
Example without Switch:
colors = [];
colors['Blue'] = function() { al...
I have this school assignment that I've been working on and am totally stumped as to why it's doing what it's doing. Basically it's a left selection list, 2 middle buttons, and a right selection list. The purpose is to move options between lists. My problem is as follows: a selection is made on left list, the move to right list button is...
Having developed web apps since 1996 I often find new ways of doing old things. So I was wondering what is the proper JavaScript tag to use on new development?
Currently I use something like this for XHTML
<script type="text/javascript">
/* <![CDATA[ */
/* ]]> */
</script>
I have read somewhere that this may cause problem with olde...
I've got a greasemonkey script and I'd like to get an idea of how many regular users I have, what I'd really like is to use Google analytics inside the script. But I'm not sure how to do it if it's even posible.
Also, the site the GM script is running on also has Analytics so would this clash prevent me from doing it?
...
how to use "insertRow" method from domplate template system to insert data to table? i cant get this to work..
...
I am not sure what I am doing wrong. The dialog box comes but it does not follow any of the settings I specified.
function voteToday(id,userid){
$(".pleaseLogin").dialog({
autoOpen:false,
bgiframe: true,
resizable: false,
width:200,
height:75,
modal: true,
overlay: {
backgroundColor: '#000',
...
I want to make some thing like this
my-php-file.php
$lang = 'es';
my-js-file.js
if ($lang == es)
{
something-magical-happens;
}
or like this:
if (URL == www.mydomain.com/index.php?lang=es)
{
something-magical-happens;
}
...