/    Sign up×
Community /Pin to ProfileBookmark

can some 1 plz help me put this javascript code inside document.write plz!!!

i have made a javascript to open a new window. the content of the new window is in the openwindow.document.write ..i wanna put a right click disable script inside the new window. can someone plz write the disable script inside the document.write plz!! 😮 😮 😮

below is my newwindow script and the right click disable script. plz some1 put them together plz!

newwindow script……….

<head>
<SCRIPT LANGUAGE=”JavaScript”>
function openindex()
{
OpenWindow=window.open(“”, “newwin”, “height=320, width=340,toolbar=no,scrollbars=”+scroll+”,menubar=no”);
OpenWindow.document.write(“<TITLE>Title Goes Here</TITLE>”)
OpenWindow.document.write(“<BODY BGCOLOR=black>”)
OpenWindow.document.write(“<b>blablabla</b>
OpenWindow.document.write(“</BODY>”)
OpenWindow.document.write(“</HTML>”)

OpenWindow.document.close()
self.name=”main”
}
</SCRIPT>
</head>
<body>
<input type=”button” Value=”open newwindow blablablablabla” ONCLICK=”openindex()”>
</body>

right click disable script……….

<script language=”JavaScript”>
var msg=”Right Click Disabled!”;
function disableIE() {if (document.all) {return false;}
}
function disableNS(e) {
if (document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {return false;}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);document.onmousedown=disableNS;
} else {
document.onmouseup=disableNS;document.oncontextmenu=disableIE;
}
document.oncontextmenu=new Function(“return false”)
</script>

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@JonaOct 20.2005 — [font=trebuchet ms]One wonders for what reason someone would cripple the UI with a disable right-click script...[/font]

<i>
</i>&lt;head&gt;
&lt;SCRIPT LANGUAGE="JavaScript"&gt;
function openindex()
{
OpenWindow=window.open("", "newwin", "height=320, width=340,toolbar=no,scrollbars="+scroll+",menubar=no");
OpenWindow.document.write("&lt;TITLE&gt;Title Goes Here&lt;/TITLE&gt;")
OpenWindow.document.write("&lt;BODY BGCOLOR=black&gt;")
OpenWindow.document.write("&lt;b&gt;blablabla&lt;/b&gt;
OpenWindow.document.write("&lt;/BODY&gt;")
OpenWindow.document.write("&lt;/HTML&gt;")

OpenWindow.document.close()
self.name="main"
}

var msg="Right Click Disabled!";
function disableIE() {if (document.all) {return false;}
}
function disableNS(e) {
if (document.layers||(document.getElementById&amp;&amp;!document.all)) {
if (e.which==2||e.which==3) {return false;}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);document.onmousedown=disableNS;
} else {
document.onmouseup=disableNS;document.oncontextmenu=disableIE;
}
document.oncontextmenu=new Function("return false")
&lt;/SCRIPT&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;input type="button" Value="open newwindow blablablablabla" ONCLICK="openindex()"&gt;
&lt;/body&gt;
Copy linkTweet thisAlerts:
@m7madauthorOct 20.2005 — thanks jona

but ur code wont work.

copy and paste it to notepad and save as file.html to see what i mean. the button is their it just wont do anything when u click on it
Copy linkTweet thisAlerts:
@JonaOct 21.2005 — [font=trebuchet ms]I copied the two codes you posted. One of them (the first) had an unfinished line. It&#8217;s fixed now.[/font]

<i>
</i>&lt;head&gt;
&lt;SCRIPT LANGUAGE="JavaScript"&gt;
function openindex()
{
OpenWindow=window.open("", "newwin", "height=320,width=340,toolbar=no,scrollbars="+scroll+",menubar=no");
OpenWindow.document.write("&lt;TITLE&gt;Title Goes Here&lt;/TITLE&gt;")
OpenWindow.document.write("&lt;BODY BGCOLOR=black&gt;")
OpenWindow.document.write("&lt;b&gt;blablabla&lt;/b&gt;")
OpenWindow.document.write("&lt;/BODY&gt;")
OpenWindow.document.write("&lt;/HTML&gt;")

OpenWindow.document.close()
self.name="main"
}

var msg="Right Click Disabled!";
function disableIE() {if (document.all) {return false;}
}
function disableNS(e) {
if (document.layers||(document.getElementById&amp;&amp;!document.all)) {
if (e.which==2||e.which==3) {return false;}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);document.onmousedown=disableNS;
} else {
document.onmouseup=disableNS;document.oncontextmenu=disableIE;
}
document.oncontextmenu=new Function("return false")
&lt;/SCRIPT&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;input type="button" Value="open newwindow blablablablabla" ONCLICK="openindex()"&gt;
&lt;/body&gt;
Copy linkTweet thisAlerts:
@saulssOct 21.2005 — ur [URL=http://www.webdeveloper.com/forum/showthread.php?t=82750]previous post[/URL] ?
×

Success!

Help @m7mad spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.27,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...