News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Need help with <iframe> stuff

Started by sayithoney, August 21, 2016, 10:25:04 AM

Previous topic - Next topic

sayithoney

Hello. First of all i dont know if this is right place to look for help, but if its not move topic.

Ok. My problem is next.
    My idea was to make a new button at main menu that will when used read webpage from another site (that would be THIS [nofollow]).
    But thing is i dont want to show whole website, instead i want just a part of it. So i googled a bit and i found that this can be usefull.
$('#target-div').load('http://www.mywebsite.com/portfolio.php #portfolio-sports');

Then coz im noob and i dont know what im doing i did this:
'roster' => array(
'title' => 'Roster',
'href' => '$('#bodyarea').load('http://armory.warmane.com/guild/The+Order+of+Dawn/Icecrown/summary #guild-sheet');',
'show' => true,
'sub_buttons' => array(
),
),

Where #guild-sheet is div from their site i want to show on my #bodyarea div when button is clicked. But when i save that and reload i get message Page isnt working.

So im asking if someone can help me make that work, or to tell me if thats posible to do?
Thank you in advance.



Kindred

I could be wrong but I am pretty sure that this won't work in SMF...  if it did, it would potentially be a security issue
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

sayithoney

Yap. its imposible. .load() works only in domain, not out domain.
Someone have some tip how to make it with iframe?
Read something about puting an anchors in iframe can do the work?

Kindred

Iframes are poor process these days anyway... Especially iframes from other domains.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor

Eh, iframes have a use. I built a site using an iframe only a couple of weeks ago.

But scraping other sites to put the content into yours is usually a bad idea. It's questionable from an ethical standpoint (misrepresenting ownership of content) and from a legal one (for the same reason)

sayithoney

Quote from: Arantor on August 21, 2016, 03:00:59 PM
But scraping other sites to put the content into yours is usually a bad idea. It's questionable from an ethical standpoint (misrepresenting ownership of content) and from a legal one (for the same reason)

Well its a private Warcraft server so i cant put self updateable Roster other way since they do not provide API.
As i see iframe is only way till they start to share data.

Advertisement: