Click to See Complete Forum and Search --> : hhheeelllppp!!!???
sciguyryan
08-11-2003, 03:09 PM
hi all,
could someone provide a script to do this:
it's like a webanguage validator, you input the code into a text box then, if yu click abutton called TEST it opens a new window displaying the effect of the script you inputed earlier.
for any help i would be gratified, thank you in advance.
i would be very greatfull if you could provide a script:D
David Harrison
08-11-2003, 03:53 PM
I think someone may have already done that (http://validator.w3.org/).
Exuro
08-11-2003, 04:27 PM
I find it quite irritating when people don't read the whole post, don't you? Anyway, I think you were looking for something like this:
<html>
<head>
<script type="text/javascript">
<!--
function testCode() {
srcCode = document.getElementById('sourceCode').value
var testWin = window.open()
testWin.document.write(srcCode);
}
//-->
</script>
</head>
<body>
<form>
<textarea id="sourceCode"></textarea><br><br>
<input type="button" value="Test" onclick="testCode()">
</form>
</body>
</html>
It's a little bit sloppy... But I'm sure you can clean it up if you want to. Hope that helps!
David Harrison
08-11-2003, 04:33 PM
Oh sorry:it opens a new window displaying the effect of the script you inputed earlierI must have skipped over that bit.
diamonds
08-11-2003, 05:36 PM
I think the subject ("hhheeelllppp!!!???") dosenmt give people a very good idea of your problem when they are looking on the main page.
anyway, try this:
<script>
function popup_html(){
var html_win = window.open('about:blank',,'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,widt h=1024,height=768');
html_win.document.write(document.html.html.value);
}</script>
Than, put this somewhere on your page(you can modify its width and height, too):
<form name="html"><textarea name="html"></textarea><input type=button value="See It" onclick="popup_html()"></form>
David Harrison
08-11-2003, 05:46 PM
I don't mean to picky but isn't that what Exuro put.
sciguyryan
08-12-2003, 05:59 AM
hi all,
will these scripts work on most or all of the web-design languages?
David Harrison
08-12-2003, 01:28 PM
Whatever you type in the textrarea is what the source of the new window will be, so yes it will work for all web-design languages. It's the equivalent of opening notepad, typing something in and saving it as a .html file.
Originally posted by lavalamp
It's the equivalent of opening notepad, typing something in and saving it as a .html file. Which means it will not work for all web design languages. PHP code requires a .php extention, ASP requires a .asp extention, SSI requires a .SHTML extention, etc....
David Harrison
08-12-2003, 01:36 PM
Well I assumed by all web-design languages he meant html, js and possibly CSS, I don't know if that is what he meant but that's what I assumed.
Also I don't know much about the languages you mentioned, but I'm hoping to soon.
I just wanted to specify that it won't work with serverside languages... :)