Personally I don't bother with escaping (backslashing) quotes in this type of usage, I find it much harder to maintain in the long term, especially if someone else has to maintain the code!
I use concatenation techniques:
document.write("<a href=" + '"' + "javascript:navigateto('" + loc + "'"...
Apart from the getElementByID error, you could try using the style visibility property instead, it seems to work better cross-browser.
document.getElementById( 'txtScore' ).style.visibility = "visible";
document.getElementById( 'txtScore' ).style.visibility = "hidden";
I'm having real problems with Firefox and the onKeyPress / onKeyDown event handlers.
Just for a change, both work fine in IE!
<script language="Javascript">
function capLock(divID,e){
kc = e.keyCode;
if (kc == 0) kc = e.charCode;
if(kc >= 65 && kc <= 90) {...
Any ideas, anyone, where I can download the
Microsoft Calendar Control 11.0 (MSACAL.OCX)
from?
I have 12.0, but I'm doing a bit of work for a client who uses Office 2003.
Does anyone out there know what version of the Calendar Control is included with Office 2003?
I've got 2007 and Calendar 12.0, but it doesn't seem to be compatible with 2003...
I've ended up using the InlineShape object. I did have a big example here, but my connection keeps collapsing and I only get seconds to send things....
I have checkbox controls embedded (InlineShape) in a word document.
Depending on values in these and other controls, sections of the document gets deleted.
My problem is, is that once sections are deleted, then the controls embedded in those sections no longer exist, so I can't use the control...
This was the ONLY way FireFox would process the line, so, yes there is every reason to reference them as an array item. No other way (apart from using the numeric array element) works.
As for invalid code. It's not invalid, it's just not compliant to some arbitrary "standard", it's perfectly...
Name your file something.php
<?php
start_session();
function getRealIpAddr() {
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
//check ip from share internet
$ip=$_SERVER['HTTP_CLIENT_IP'];
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
//to check ip is pass from proxy...
OK, I've bashed myself upside my head and made a correction...
function SubmitForm(What,DoWhat) {
var f=document.getElementById(What);
f.Task.value = DoWhat;
f.submit();
return true;
}
later...
<form name="modForm1" id="modform1" action="etc">
<input type="button"...
I've firebugged this script and it's not the value that's the problem
function SubmitForm(What,DoWhat) {
var f=document.getElementById(What);
f.Task.value = DoWhat;
f.submit();
}
f is equal to null after the getElementById. Why won't this work in FireFox?
Do I have to use some...
if (ipaddr == '63.131.12.999')
{
window.location="videoindexgoodip.htm";
}; // get rid of this semi-colon
else
{
window.location="videoindexbadip.htm";
;
}
%%IP%% is just a place holder tag. You need to replace it with something. Normally a bit of REGEX would do the job.
Just as a suggestion, I've lately been using Matt Kruse's DynamicOptionLists from http://www.javascripttoolbox.com.
After a bit of monkeying around it works great.
I'm generating the linked lists using PHP from a mySQL database, but I suppose any scripting would work, even hard-coding...
Try this
<a href="javascript:void(0)" onclick="javascript:open_url('page-1.html','my_site_content');">Announcement 1</a><br>
make sure that "page-1.html" is in the current folder, otherwise, tell the function where the file is.
Has anyone meet this before
I have this Javascript function that is supposed to change a value before submitting the form.
The form name is dynamic, so is the value
function SubmitForm(What,DoWhat) {
var f=document.getElementById(What);
f.Task.value = DoWhat; // <<<<<< FireFox fails on...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.