PDA

View Full Version : Award Script (using popup windows)


vkidv
09-06-2002, 07:55 PM
i need to make an award script for like a 'good website', my idea of a award would be a javascript external file which document.writes the award code - to REDUCE amatuer theft.

i would use the document.write code and document.write(document.title) and stuff - correct that if im wrong (how to document write title of page, is that how you do it? document.write.(document.title?))

but i would like the award to be a bit like this..
on the site which has the award there would be a link like 'Check this site's award' when they click this - a javascript NEW window would appear - i dont want this to be another .html/.htm file it will be predefined in the code...
how can i make javascript make a window - with the html what is going to be in the window
in this window would be the award - with the document.write(document.title) of the parent page (award winner's site)

all this would be in the external javascript so to the award winner - installing it would be extremley easy (ect. external javascript remotley hosted - they just type in javascript src thing blah blah which would be already provided)

i know this is possible - but dont know how, please help...
regards
sam

vkidv
09-06-2002, 08:10 PM
i think the code would look somthing like this (the external javascript file)


<script>
function award() {
window.open
title=document.write(document.title)
awardcode=<award code here>
("<title of first page (parent page)> ","<html>","<content <award code>>","<width>","<height>","<properties>")
}
document.write("<A HREF="" onClick="award()">See my award</A>")



i know it nothing like its acurate - just a thought... and how would i get document.write(document.title) into the title of the NEW page which is the title OF the base page? would it be a variable or a function - please type this code on here / or help me

<< the above is JUST a thought >>

beetle
09-06-2002, 09:09 PM
function awardWin() {
var newWin = window.open('','newWin','width=300, height=300');
with (newWin.document) {
writeln('<html><head><title>');

...etc etc...

writeln('</body></html>');
close();
}
}

vkidv
09-06-2002, 09:13 PM
would i write the code for it in here? ::


function awardWin() {
var newWin = window.open('','newWin','width=300, height=300');
with (newWin.document) {
writeln('<html><head><title>');

code here? using writein() ???

writeln('</body></html>');
close();
}
}


so i keep writing writein(<code> for each piece or code?

vkidv
09-06-2002, 09:27 PM
would
document.write(document.title)
work in this, ? by putting this in the new window's text would it write the new windows title or the FIRST window's title?


i dont understand

scroots
09-07-2002, 07:56 PM
you may wish to add an a refer checker to your script file otherwise, i could go on a site which has an award and then just copy and paste there code for it, and it would work on my site. if you host the script in a .js you can do a refer check and only allow certain sites access.


scroots

vkidv
09-07-2002, 08:15 PM
how may i acomplish this?

how can i create a refer checker?

would this be in the script itself?