i would say multiple lines are better as its more readable instead of all in single lines.

Paul_Wilkins
—
2011-03-24T01:14:42Z —
#3

mikehende said:

Which is best practice or format? Does the script have to be all on one line or can it be on many separate lines like this?

It can be on separate lines, but it looks like you're doing something wrong with those return parts.

mikehende
—
2011-03-24T01:23:23Z —
#4

Thanks, on another issue, concerning the document.write object and method, when using it, if you wish to use it to write "multiple" lines of text at different times in one script, do you use it only once or do have to use it each time you need to write the text?

Paul_Wilkins
—
2011-03-24T01:28:12Z —
#5

mikehende said:

Thanks, on another issue, concerning the document.write object and method, when using it, if you wish to use it to write "multiple" lines of text at different times in one script, do you use it only once or do have to use it each time you need to write the text?

It's normally advised to stay away from document.write as there are almost always safer techniques to use.

Having said that though, it's more efficient to add the content you want to output to a variable, and to then output that at the end of things.

but that is the only source which I am understanding so I have to deal with things a little differently when it comes to modern day JS just so you understand what I am dealing with, I haven't gotten to var yet, I am following the course as structured. So, would it be possible for you to break down any further what what you have written please?

If so, my questions, using your example would be:

1] To begin using the write method, should I use this var html = ''; every time?

2] What are the 3 dots for between each line?

3] Should I always write this html += '<p>Some text</p>'; when referring to text?

4] If you are saying I should stay away from the document.write then why use this document.write(html); at the end?

late here now, will check back in the morning for any answers, thanks!

Paul_Wilkins
—
2011-03-24T02:08:10Z —
#7

mikehende said:

So, would it be possible for you to break down any further what what you have written please?

Sure thing. I just had a look at your source, and it appears that the "return" parts from what you quoted, are actually the image that was used on the web page to indicate a new line.

I won't get in to the pros/cons of document.write just yet. Instead, here's something about what you were asking, the formatting of a statement.

Notice how it's easier to understand that last example? The main purpose of formatting is to reduce confusion when you and other people read your code. One of the best ways to reduce confusion, is to follow a style guide or code conventions for your code. These help to enforce good practices, so that confusion is reduced to a minimum.

A better online learning resource that you may want to consider has been receiving high praise lately. You may want to check out Eloquent JavaScript instead.

mikehende
—
2011-03-24T11:53:47Z —
#8

paul_wilkins said:

I just had a look at your source, and it appears that the "return" parts from what you quoted, are actually the image that was used on the web page to indicate a new line.

Sorry, I don't understand, any other wya you can explain the purpose of "return"?

Also, I looked at your link but that seems way too technical for me so I will stick with the one I am using for now but thanks anyway.

Paul_Wilkins
—
2011-03-24T12:07:20Z —
#9

mikehende said:

Sorry, I don't understand, any other wya you can explain the purpose of "return"?

Sure. Let's go back to the code that you posted, which started all of this.

Ok, thanks but what I should have asked is "why" would someone NOT want the window to be resizeable?

Paul_Wilkins
—
2011-03-31T13:14:29Z —
#14

mikehende said:

Ok, thanks but what I should have asked is "why" would someone NOT want the window to be resizeable?

The link from the documentation to the bug report seems to make a similar case.

mikehende
—
2011-03-31T13:23:48Z —
#15

Last issue on this topic please, I am having trouble understanding these two since I cannot see it happening I think:

location=yes or noWhether or not you wish to show the location box with the current url (The place to type http://address).

directories=yes or noWhether or not the window should show the extra buttons. (what's cool, personal buttons, etc...).

Can you give me an example of both? When I use those 2 attributes I don't see anything on my end?

Paul_Wilkins
—
2011-03-31T13:32:17Z —
#16

mikehende said:

location=yes or noWhether or not you wish to show the location box with the current url (The place to type http://address).

If you look on the same page of the [window.open documention, you will see that in [url="https://developer.mozilla.org/en/DOM/window.open#section_7"]section #7](https://developer.mozilla.org/en/DOM/window.open) it says that Firefox now always forces location to be shown.

mikehende said:

directories=yes or noWhether or not the window should show the extra buttons. (what's cool, personal buttons, etc...).

The same section of the documentation page says that directories is now obselete.It was supported in old web browsers up to IE6, but not in more recent ones.

There's little that I can add to the information that you get from there.

mikehende
—
2011-03-31T13:44:08Z —
#17

Not really what I am asking, let me try another way, what "location box" is this referring to, the new pop up window? If yes then what "current URL" is this referring to? Does this all mean whether or not the pop up window should show the URL of the page you are reading from?

Paul_Wilkins
—
2011-03-31T13:47:29Z —
#18

mikehende said:

Not really what I am asking, let me try another way, what "location box" is this referring to, the new pop up window?

Yes

mikehende said:

If yes then what "current URL" is this referring to?

The one of the popup window.

mikehende said:

Does this all mean whether or not the pop up window should show the URL of the page you are reading from?

That's right.

mikehende
—
2011-03-31T13:50:51Z —
#19

Cool! Regarding this:

directories=yes or noWhether or not the window should show the extra buttons. (what's cool, personal buttons, etc...).

When I use the directories=yes I am not seeing the "extra buttons" mentioned, can you elaborate on this please?

Paul_Wilkins
—
2011-03-31T13:57:15Z —
#20

mikehende said:

Cool! Regarding this:

7. directories=yes or noWhether or not the window should show the extra buttons. (what's cool, personal buttons, etc...).

When I use the directories=yes I am not seeing the "extra buttons" mentioned, can you elaborate on this please?

I've tried to direct you to the information twice already on the documentation page. Now it's time to blatently dump that info here.