PDA

View Full Version : How to show the external page content using java script ?


ishare
12-21-2008, 07:57 AM
Hi,

I have another webpage which is installed on my server and i would like to use the content of this page on my vbulletin forum.

I would like to show the content of an external page, using java script instead of iframe. Due to each movie has different size of content, its diffucult to use same size iframe for all. So for sure javascript will be much better.

An example :
<script src="http://services.imflexi.com/imdb/tt0172495/"
type="text/javascript"></script>

I have also a custom bbcode called "movie". So to show the content of above page, i use "{param}" in my forum.

Above is just an example. The page i would like to show the content is much different.

The problem is, i do not know how to use the javascript to show my own external page's content.

Does anyone know how to show an external page content in my vbulletin forum using java script ?

Thanks in advance...

Lynne
12-21-2008, 02:59 PM
The way vbulletin does it is by having a script, external.php, which gets called to serve up the content. So, you would have to write a script to serve up the content of your page and use that script in your javascript call.

ishare
12-21-2008, 04:35 PM
Example :
http://www.dwshare.com/imdb/imdb.php?mid=0960144

As you can see from above page, i have the .php pages. There is nothing wrong with that.
I would like to show the above page in my forum.

I have prepared a bbcode called movieinfo for that.
BBCode Content :
<script src="http://www.dwshare.com/imdb/imdb.php?mid={param}"type="text/javascript"></script>
So when a user use the movieinfo bbcode as : 0960144 he/she will display the above example's content.

Ofcourse i can show this content in iframe. But as i mentioned in my first message, due to all movies do not have same size info, its diffucult to use one size iframe. (Example : width:700px - height:280px) And beside that, it will not fit the style.

When i checked this (http://www.globya.net/news/read/n/16/IF/ImFlexi-Web-Servisleri-Acildi/) webpage, i see that its possible to use javascript to display the content of an external page. When i use the movieinfo bbcode with other sites javascript code (at first message), its working.

So i would like to be able to do the same for my own page too. Through google, i learned that with document.write command we can display the info but i couldnt do that.

Thats why i opened this thread if i can find a way to do this kind of simple(!) javascript modify.

Regards