...

View Full Version : few source



JAVAEOC
01-10-2004, 03:08 PM
function source()
{
location="view-source:" + window.location.href
}

this function would few the source in the same window... but how can i tell it to open a new window?

liorean
01-10-2004, 05:25 PM
Use window.open, and send it the same URL as you were writing to the location of the current window.

JAVAEOC
01-10-2004, 06:39 PM
but it doesnt work

function Source(){
location="view-source:" + window.open.location
}

now it doesnt do anything :(

then i tried this:

function Source(){
location="view-source:" + window.open('MenuV.5.htm').location
}

that gives me a blank page :(

nolachrymose
01-10-2004, 06:50 PM
function Source() {
window.open('view-source:' + location.href);
}

Hope that helps!

Happy coding! :)

JAVAEOC
01-10-2004, 06:55 PM
it doesnt work either :(

JAVAEOC
01-10-2004, 07:11 PM
<html>
<head>
<title>OLECMDID</title>

<script>
function printpr(OLECMDID)
{
//var OLECMDID = 10;
/* OLECMDID values:
* 6 - print
* 7 - print preview
* 8 - page setup (for printing)
* 1 - open window
* 4 - Save As
* 10 - properties
*/
var PROMPT = 1; // 1 PROMPT & 2 DONT PROMPT USER
var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0

CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
WebBrowser1.ExecWB(OLECMDID,PROMPT);
WebBrowser1.outerHTML = "";
}
</script>
</head>
<body>
<form name="form">
<select name="olecmdid">
<option value="6">print
<option value="7">print preview
<option value="8">Page Setup for printing
<option value="1">Open File
<option value="4">Save this web page as....
<option value="10">View the properties of this file
</select>
<input type="Button" value="Go" onclick="printpr(document.form.olecmdid.value);">
</form>
</body>
</html>

cool script that thing above... it can do everything i want but it only works in IE, is it possible to do all these things in mozilla + few source in a new window, cause that still dosnt work

thanks for any help

JAVAEOC
01-10-2004, 07:20 PM
more cool stuff : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/com/htm/oen_a2z_22sk.asp

again is that also possible in mozilla?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum