javascript:window.open

I use this javascript[javascript:window.open(‘http://www.quartoprofilo.com/chatqp2.php’)] for open a new window but with firefox the script will open the window plus a blank window. No problem with safari. Can anyone help me?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

That script seems fine to me. A new tab (or Window if I change the
preference) opens when I use the code in the address bar. Can you send
us the page that it is happening on.

Joe

On 29 Apr 2008, at 21:59, ANDREA wrote:

I use this javascript[javascript:window.open(‘http://www.quartoprofilo.com/chatqp2.php’)
] for open a new window but with firefox the script will open the
window plus a blank window. No problem with safari. Can anyone help
me?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

One would normally use the ‘javascript:…’ statement in place of a normal href value.

In FW context, this ‘href’ value is whatever you have selected in the Hyperlink Dialog. I am guessing that you pasted this command in the ‘external’ tab of the Hyperlink Dialog.

In that case, the outputted code would look something like:

< a href=“javascript:window.open(…);” > LINK < / a >

instead of the traditional:

< a href=“/folder/page.html” > LINK < / a >

If there was a ‘target’ attribute on the link, this might cause Firefox to: 1) open a new window per the target attribute (presuming a value of something like ‘_blank’), 2) feed that new window the href value of: javascript:window.open(), resulting in 3) a second new window being opened with actual content.

In FW, on the problem link, look for the mentioned ‘target’ attribute in the Hyperlink Dialog.

Again, not seeing the actual page (which would still be helpful to examine), and basing this on the above presumption, in your particular circumstance, the ‘target’ attribute would be unnecessary.

[[ It is possible that a target value is being added in a slightly different position (via the < base > tag). All the more reason to see the actual page. ]]


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Why use the javascript at all - why not just link as normal in freeway to the external page with target: _blank

Or am I missing the point? - What if the visitor doesn’t have javascript enabled?

David


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I have a report that seems most related to this existing thread; however, I am a bit leery about posting here as poor DeltaDave never received a reply for the past 8 months. May my post fair better!

I recently had the need to use onclick="window.open… on my site. My aim was to use Freeway’s Spawn New Window action on a page in my site to open a small window above the existing browser window. Then when someone clicks on that link in that new window, two things happen: (1) that little window closes and (2) a new page opens in the underlying open browser window.

I achieved this by adding the following code:

On the main page in my site, using Page > HTML Markup > Before :

On the little “Spawn New Window” page, using Source Code Snooper on my HTML box containing a text link:

{A HREF="faq.html" TARGET="sciborgmain" onclick="window.open(this.href,this.target);window.close();return false;">

(The “{” is actually a “<” but this forum won’t let me enter it!)

You can view the actual web page in action here:

Just click the “CAN-BUS” bubble in the upper-left section of that web page to Spawn the little window. When that window opens, click the text link at the bottom of that new window. You will see the new window close and new content appear in the original window.

Works great in Safari 3 on Mac and WinXP, on FireFox WinXP and MSIE 6 on WinXP. But for whatever reason, it doesn’t work right on Firefox 2. However, after upgrading to Firefox 3 Mac, it works perfectly. So I must assume this to be a bug in FF2 rather than a problem with my code. If someone more experienced than me feels otherwise though, I would appreciate hearing your thoughts.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hate to disappoint you JDW - and no I haven’t been lurking here since April for a reply - but it didn’t do as you suggested it would for me.

With FF 3.0.4 I get your new window and when clicking the link to the FAQ page the new window closes but a new tab opens with the FAQ page in it.

So I have the original page and the FAQ page

Safari 3.2.1 does it right!

David


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

DeltaDave! Thanks for posting a reply. I can take comfort in knowing that at least you and I are willing to make time to post!

You are correct about FF3. I just noticed it now. It does indeed make a new tab. That’s discouraging. But is it a FF setting perhaps? If not, would one of you JS wizards be willing to take a few moments of your time to post a comment about my code and explain why FF3 is creating a new tab.

Yes, Safari does it right. But Safari is a blasted fool when it comes to displaying ALT text. Safari used to do its job properly in that regard long ago, but no longer! I have to use FF to view ALT text on my graphics now. What really surprises me is that NO ONE is talking about this. Apparently, there is utter apathy toward the display of ALT text in the web design world, otherwise I would expect forums to be filled with angry posts over the issue. I know it irks me beyond words. But I will compose myself and stop here, as this is a subject for another thread.

Thanks again for posting!


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

would one of you JS wizards…

I am afraid that is not me so you will have to hope one of them stops by.

D


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options