Jump to content

Working in Firefox but not Chrome etc.


ALD2355

Recommended Posts

I have this code below that I found and installed about two years ago but now does not work.  It works in Firefox but not Chrome/Iron etc. and I am not sure how to check it.

 

The code is on a number of maps at www.sysmaps.com such as http://www.sysmaps.co.uk/sysmaps_cm.html and the email buttons are 'Link' and 'Email' which are supposed to email current positions.

 

The js and php are attached.

 

Thanks

 

function updatefields()

{

 

var query = mid(window.location.search,3,10000);

//alert(query);

 

//Remove %20 as in Chrome, Firefox etc but not in IE

oldtext = "%20";

newtext = " ";

 

var i=0;

for (i=0;i<=10000;i++)

{

query = query.replace(oldtext,newtext);

}

 

//Firefox put 0+ at the beginning of the line

query = query.replace("0+","");

 

//alert(query);

document.getElementById('S1').innerHTML = query;

 

var browser=navigator.appName;

//alert(browser);

 

oldtext = "^";

 

if (browser != "Netscape")

{

newtext = "\n";

}

else

{

newtext = "\n";

}

 

var i=0;

for (i=0;i<=10000;i++)

{

query = query.replace(oldtext,newtext);

}

//alert (newtext + " : " + query);

 

document.getElementById('S1').value = query;

//alert (document.getElementById('S1').value);

}

 

function mid(str, start, len)

{

// Make sure start and len are within proper bounds

    if (start < 0 || len < 0) return "";

    var iEnd, iLen = String(str).length;

    if (start + len > iLen)

          iEnd = iLen;

    else

          iEnd = start + len;

    return String(str).substring(start,iEnd);

}

 

function CheckEmail(){

//Show the message in the status bar

window.status="Sending email...";

//Check if the ASP/PHP email page was already loaded

if(EmailSenderAccessed){

//Now check if the email was sent or not and show the message

if(EmailSended) window.alert("The email was sent succesfully!");

else //window.alert("The email could not be sent");

window.status="";

}

else{

//Check the email sending timeout

if(checkcount>maxchecks){

//window.alert("Email sending timeout (" + ((checkinterval*maxchecks)/1000) + " sec) try again later");

return;

}

//Update number of check counts

checkcount++;

//If ASP/PHP email page is not loaded yet, then check it again in the specified interval

setTimeout("CheckEmail();", checkinterval);

}

}

 

function SendTheEmail(form){

 

//First create the Mail() object and set in on a variable

var easymail=new Mail();

//Set the server type, so the script can know which page to call, the asp or php, if you are using a PHP server

//replace the "ASP_SERVER" with "PHP_SERVER", by default the server is set to PHP_SERVER

easymail.ServerType=PHP_SERVER;

//Now set the address to which the email will be sent

easymail.To=form.T1.value;

//Add the CC address

easymail.Cc=form.T2.value;

//Add the BCC address

easymail.Bcc=form.T3.value;

//Now set the address of the one that sends the email

easymail.ReplyTo=form.T4.value;

//Now set the subject of the email

easymail.Subject=form.T5.value;

//Set the message of the email

easymail.Message=form.S1.value;

 

//Send the email

easymail.Send();

//Now call the function what will alert user when email was sent

CheckEmail();

}

Link to comment
https://forums.phpfreaks.com/topic/255080-working-in-firefox-but-not-chrome-etc/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.