Writeln() Question
Jul 12, 2005
I'm using the following code to write to a new document. It is supposed to display image img, which is a map to the business. It opens a new windows properly, but the image does not display (it is in the correct location, btw). I've tried adding a URL to the window instead, and this does not display either. I've checked the source code, and it looks good. I must be missing something very simple. Does anyone see what I am missing?
newwindow=window.open('','','width=630,height=630,resizable=0,top=50,left=50');
newwindow.document.writeln('<html>');
newwindow.document.writeln('<head>');
newwindow.document.writeln('<title>Company Map</title>');
newwindow.document.writeln('</head>');
newwindow.document.writeln('<body>');
newwindow.document.writeln('<img src="images/' + img + ' />');
newwindow.document.writeln('</body>');
newwindow.document.writeln('</html>');
newwindow.document.close();
View 1 Replies
Jan 20, 2006
I can get the escape character " " or document.writeln to give me a new line.
Or for that matter any of the form feed " f " or carriage return " " to work either.
I can get the escape character " " " I'm using XP home with SP2 with IE6 all my security setting set to Prompt so if that was an issue then at least I should get a prompt for allowing the
script to work. I put my JavaScript in a .js file and have referenced it from the HTML page.
I've tried this on different machines that also use XP with IE6, is this a problem with IE?
I've tried:
<script type= "text/javascript" src="assets/beagle.js">
..........
View 4 Replies
View Related
May 23, 2011
Not sure why this is not working but can someone see my error.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
[Code].....
View 4 Replies
View Related
Jul 23, 2005
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>test</title>
</head>
<body>
<script type="text/javascript">
try{
var foo=document.writeln;
foo( 'Hello, world!' );
}
catch( e ) {
alert( e );
}
</script>
</body></html>
IE has no problem with this, but Firefox throws an exception - "Illegal operation on WrappedNative prototype object". Is it within its rights to do so?
View 2 Replies
View Related
Aug 8, 2011
For example I have a link that I want to when I click on it, It writes some words after the link. I have written a code but it does not work as I want and it clears all the page and writes the words. I don't want to clear the page and write just words, I want to add words after the link.
Here is my code:
HTML Code:
<script type="text/javascript">
function a() {document.writeln('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');}
</script>
<a name="aaa" href="javascript:void()" onclick="a()">Click on me!</a>
View 1 Replies
View Related
Apr 7, 2011
is there any way I can stop document.write from outputting info to a new page I would prefer to have it shown in a textarea.
Info from an array that is suppose to display in a text area when button is clicked and when another button is clicked it is suppose to show some other info. But what happens is the first info displays in textarea for a few seconds and then the second info is displayed but on a new page and not the textarea where I want it to go
I have marked code within the code // I want this specific code to be displayed second but I know its in the wrong spot.
Here is the code
[CODE]
function show()
{
var myArray = new Array();
[Code]....
View 5 Replies
View Related
Jul 16, 2010
I am trying to write a bunch of text onto a new document using document.write() and somehow need to format it to include line breaks.
For example:
Code JavaScript:
document.write(Line 1);
document.write(Line 2);
I have tried including and it does not work. I have also tried document.writeln() and that also does not work. From what I have found on the Internet, one (if not both) of those methods should have worked.
View 3 Replies
View Related
Nov 4, 2007
sometimes document.write doesn't work for me but document.writeln always does..
View 3 Replies
View Related
Oct 28, 2009
I have three files:
HTML file (default.htm)
Code:
<body>
THE QUICK BROWN FOX JUMPED OVER THE LAZY OLD DOG
<script type="text/javascript" src="testing.js"></script>
[Code]....
When I run the above files the original text on default.htm is wiped and replaced by the document.writeln text in test2.js. What I wanted to happen was for this text to be added to the default.htm page (and not wipe what was already there). I believe this is because the htm file has already parsed.
I know people say you should use innerHTML and not document.write or document.writeln. Unfortunately, I have no control over the contents of the first file (default.htm) or the third file (test2.js) but the content in test2.js will always be in either document.write or document.writeln format. So I cannot use innerHTML.
My problem is how can I (from within the second file, testing.js) ensure that the page is not parsed before the third file has finished.
View 5 Replies
View Related
Nov 15, 2005
I'm learning JavaScript, and I have learned very much of the language. But I don't know what the difference between document.write and document.writeln is.
Can somebody tell me the difference?
View 1 Replies
View Related