Open website in Shadowbox using JavaScript

7 messages Options
Embed this post
Permalink
GeorgeGub

Open website in Shadowbox using JavaScript

Reply Threaded More More options
Print post
Permalink
(This post was updated on )
GeorgeGub

Re: Open website in SandBox using JavaScript

Reply Threaded More More options
Print post
Permalink
Anyone? Please, it's really important and i have tryied everything.
otheroom

Re: Open website in SandBox using JavaScript

Reply Threaded More More options
Print post
Permalink
I'm not quite following what you're trying to accomplish.

Are you trying to have a SB window open at page load?

Do you want to know what javascript to use to open a SB window?

Are you just trying to get an external site to open in a SB iframe?
ravishsehgal

Re: Open website in SandBox using JavaScript

Reply Threaded More More options
Print post
Permalink
Hi i want to open a custom URL i mean i have to make a custom string of URL and then want to pass that in a shadow box pop-up and that too with a button not link, also when i close Shadow box the parent window should get refresh.
please help with ideas...and few steps will really be helpful...
thanks in advance
GeorgeGub

Re: Open website in SandBox using JavaScript

Reply Threaded More More options
Print post
Permalink
In reply to this post by otheroom
You are correct, it was a bad explanation. Let me explain in a better way:

I'm oppening a link in a new tab/window by using JavaScript:

window.open('http://www.example.com/','_blank');

This is the same like < a href="http://www.example.com/" target="_blank" >

I just want to open this external website NOT in a new window, but in a Shadowbox iFrame.

It can be done by HTML (< a href="http://www.example.com/" rel="shadowbox" >) but I need to do it using JavaScript. Is there a way?
otheroom

Re: Open website in SandBox using JavaScript

Reply Threaded More More options
Print post
Permalink
I would think that you could make a javascript call like this:

Shadowbox.open({
        content:    'http://www.site.com/page',
        player:     "iframe",
        title:      "New Window",
        height:     350,
        width:      350
    });

Of course you'd have to have called shadowbox_init() already.
GeorgeGub

Re: Open website in SandBox using JavaScript

Reply Threaded More More options
Print post
Permalink
Thank you very much! That's exactly what I wanted!

PS: I'm feeling a little stupid because it was quite easy..