Click to See Complete Forum and Search --> : Problem That Needs An Expert


BDStagg
12-16-2002, 05:12 AM
Is there a way of making a piece of html to get a URL and then having javascript in that URL to hide the toolbar and frames instead of using java in like:
windowHandle = window.open(URL , windowName , features) ?

The whole point of this is so i can use java and flash? I have had trouble with the fact that when flash uses java there has to be java within the published html for it to work and as my web page is forwarded it is within a frame with its own html i cannot edit?

Also is there is a way of targeting java to the frames html from the framed html without having to put java in to that frames html itself?

Plz post what you can to help. I think i may have stopped a few people with this one?

All the best,

B D Stagg.

swon
12-16-2002, 05:22 AM
Hi,


I'm not sure but I think you want to something like this:

function openingNew()

{

var w = window.open();
w.document.open();
w.document.write("<html><head></head><body>embed something you like<p class=\"yourclass\"> flash or jscript etc.</p>");
w.document.write("</body></html>");
w.document.close();

}

make sure that document.write is always on the same line,
else you must make a new line


Swon

BDStagg
12-16-2002, 01:10 PM
Is there any chance you could post a working example as i have tried messing with the script you wrote but have had no such luck?

swon
12-16-2002, 04:51 PM
<html>
<script language="JavaScript">
<!--
function openingNew()

{

var w = window.open();
w.document.open();
w.document.write("<html>\n<script language=\"javascript\">\n");
w.document.write("\n function showAlert()\n{ \n\n flash_id = document.getElementById(\"flashid\").attributes['id'].value;\n")
w.document.write("\n alert(\"ID of the div for the flash :\" + flash_id + \" --- I do not have knowledge in java but it should works too!\")");
w.document.write(";\n}\n</script>");
w.document.write("\n<body><div id=\"flashid\" style=\"border:1px solid black;height:60;width:468;\" title=flashbanner></div><br>");
w.document.write("for example the button below or the flash above with an event or using java <br>\n<button onClick=showAlert()>show Alert</button>");
w.document.write("<br><br>I don't know how to do it with java! But I'm sure you have to put it within\n</body>\n</html>");
w.document.close();

// Am I right with this?
// I think this must works with java code within too!
// If you want a frameset do it this way too! ( w.document.write("<frameset rows=\"60,*\"....
}
//-->
</script>

<body style=background:buttonface>
<center><button onClick="openingNew()">New location</button></center>
</body>
</html>

Hope it helps you..


regards

Swon