Jump to content

I have run into a problem...


clonetrooper9494

Recommended Posts

For some reason, this is just not working!!! I am trying to make a simple 'include on every page thing' by putting a code of JavaScript on every page, but this just is not working no matter what I do! no error messages, nothing at all! Arg I just want to throw my computer out my window(even though it has nothing to do with it)Here is the code:

<html><head><title></title></head><body oncontextmenu="return movemenu()" onclick='movemenuback()'>test<textarea style="display:none" id="addon"></tr></td><tr><td><hr width="90%"></td></tr><tr></textarea><textarea style="display:none" id="extra"></textarea><script>var x = '0';var y = '0';function show_coords(e){	e = (e) ? e : window.event;	x = e.clientX;	y = e.clientY;}document.onmousemove = show_coords;function movemenu(){document.getElementById('menu').style.left = x + 'px';document.getElementById('menu').style.top = y + 'px';return false}function movemenuback(){document.getElementById('menu').style.left = '-100px';document.getElementById('menu').style.top = '-100px';}var t = document.getElementById('extra').value;var p = document.getElementById('addon').value;if(t == ''){var write_in = '';}else{var write_in = p + t;}var abc = "<div id=\"menu\" style=\"position:absolute;top:-100;left:-100;display:block;\"><table border='1' bgcolor='EEEEEE' bordercolor='BBBBBB' style=\"border-collapse: collapse;\"><tr><td><table border='0' bgcolor='EEEEEE' bordercolor='BBBBBB'><tr><td onmouseover=\"this.style.backgroundColor = '#BBBBBB'\" onmouseout=\"this.style.backgroundColor = '#EEEEEE'\" style='background-color:EEEEEE;' onclick=\" window.location='http://clone-drone.net'\">Home</tr></td><tr><td onmouseover=\"this.style.backgroundColor = '#BBBBBB'\" onmouseout=\"this.style.backgroundColor = '#EEEEEE'\" style='background-color:EEEEEE;' onclick=\" window.location='http://clone-drone.net'\">Games</tr></td><tr><td onmouseover=\"this.style.backgroundColor = '#BBBBBB'\" onmouseout=\"this.style.backgroundColor = '#EEEEEE'\" style='background-color:EEEEEE;' onclick=\" window.location='http://cmail.clone-drone.net'\">Clone-Mail" + write_in + "</tr></td></table></tr></td></table></div>";document.write(abc)</script></body></html>

Here is the link:http://www.clone-drone.net/ajax_test.html

Link to comment
Share on other sites

Well, the most important problem here is this:var abc = "<div id=\"menu\" style=\"position:absolute;top:-100;left:-100;display:block;\"><table ...You can't insert a line break within a line of Javascript code.You can use \n or escape them with \.Like this:var abc = "\n<div id=\"menu\" style=\"position:absolute;top:-100;left:-100;display:block;\">\<table ...

Link to comment
Share on other sites

so, I have to make it like this?? ...:

var abc = "<div id=\"menu\" style=\"position:absolute;top:-100;left:-100;display:block;\">\n<table border='1' bgcolor='EEEEEE' bordercolor='BBBBBB' style=\"border-collapse: collapse;\">\n<tr><td>\n<table border='0' bgcolor='EEEEEE' bordercolor='BBBBBB'>\n<tr><td onmouseover=\"this.style.backgroundColor = '#BBBBBB'\" onmouseout=\"this.style.backgroundColor = '#EEEEEE'\" style='background-color:EEEEEE;' onclick=\" window.location='http://clone-drone.net'\">\n\nHome\n\n</tr></td><tr><td onmouseover=\"this.style.backgroundColor = '#BBBBBB'\" onmouseout=\"this.style.backgroundColor = '#EEEEEE'\" style='background-color:EEEEEE;' onclick=\" window.location='http://clone-drone.net'\">\n\nGames\n	ECT.

Does everything have to be on the same line like up there?

Link to comment
Share on other sites

Either all on the same line, or you escape the line breaks by putting a \ at the end.But again, why are you trying to generate all that HTML instead of just wtiting it right there?

Link to comment
Share on other sites

Ok, I need it to be like this:

<html><head></head><body oncontextmenu="return movemenu()" onclick='movemenuback()'><script src="the code above"></script></body></html>

I want to include it on every page... without having too much other junk, and so if I make a major change, I don't have to go through every file making that change!

Link to comment
Share on other sites

That would make every page on my site .php ... is there a way to make your site excute PHP if it was .html? I know some sites that are .phtml , does that mean I could try and edit something to do that?I already have the PHP to do it in another file...

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...