View Full Version : Too Much PHP/JavaScript / Killed My Page
tomyknoker
06-05-2006, 02:55 AM
I have this page http://www.australianairtours.com.au/2006/test_email.php, which was previously working fine until I added some new code which I got from this example http://www.sws-tech.com/scripts/tellafriend.php, GREAT script but doesn't appear to work on my page... I have also lost a fair bit of my JavaScript functions... Any ideas?
You don't have "sendemail.php." Also, it's quite difficult to debug something that isn't there.
tomyknoker
06-05-2006, 08:53 AM
You don't have "sendemail.php." Also, it's quite difficult to debug something that isn't there.
Hi There,
Well I have added the email code, and now my random images don't load... In the header I have 5 images which are meant to load but adding the email code killed it...
tomyknoker
06-05-2006, 11:12 AM
Ok, everytime I add the code below:
<!--
function newWindow(mypage,myname,w,h,features) {
if(screen.width){
var winl = (screen.width-w)/2;
var wint = (screen.height-h)/2;
}else{winl = 0;wint =0;}
if (winl < 0) winl = 0;
if (wint < 0) wint = 0;
var settings = 'height=' + h + ',';
settings += 'width=' + w + ',';
settings += 'top=' + wint + ',';
settings += 'left=' + winl + ',';
settings += features;
win = window.open(mypage,myname,settings);
win.window.focus();
}
to this page http://www.australianairtours.com.au/2006/test_email.php, it kills my randome image loader and kills the css on my site. The complete code of this page is here http://www.australianairtours.com.au/2006/test_email.txt
I don't see that code in there anywhere... you need to put it *in* the page so I can see what you're doing wrong.
tomyknoker
06-05-2006, 11:42 PM
Ok here is the code, just didn't put it in because it kills the page and wasn't sure where it would go: http://www.australianairtours.com.au/2006/test_email_all_code.txt and here's what it does to the page: http://www.australianairtours.com.au/2006/test_email_all_code.php
<script language="JavaScript">
<!--
function newWindow(mypage,myname,w,h,features) {
if(screen.width){
var winl = (screen.width-w)/2;
var wint = (screen.height-h)/2;
}else{winl = 0;wint =0;}
if (winl < 0) winl = 0;
if (wint < 0) wint = 0;
var settings = 'height=' + h + ',';
settings += 'width=' + w + ',';
settings += 'top=' + wint + ',';
settings += 'left=' + winl + ',';
settings += features;
win = window.open(mypage,myname,settings);
win.window.focus();
}
</script>You never close that SGML comment delimiter. In fact, you should remove the opening one as well; it hasn't been necessary for a long time.
As you can see from the forum's HTML highlighter, this has the effect of commenting out all the code down to the end of the next <style> element, which has a matching close-comment delimiter.
Cold Gunmetal
06-07-2006, 01:35 PM
My site did the same thing. Even killed my buttons.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.