hello, i have a page2.html, i have 1 button of 300x250 in this html page now i want to show this page in a iframe into my other sites, therefore i can use the next code: <iframe src="http:// mywebsiteurl/page 2. html" name="iframe985426" width="300px" height="250px" scrolling="auto" frameborder="1" align="center"></iframe> but is it possible to show this page2.html without a iframe code into my other sites? a code where i dont need to put width and height. the code must only show the content of page2.html?
Hello, You could it by using Jquery. <script>$("#test1").load("http:// mywebsiteurl/page 2. html");</script> <div id="test1"></div> I think, this code will work.
Do you have access to all domains (are you the same owner for both domains and able to get server changes on both)?
you cant use that because of CORS. you can either load it on the backed via a request and dump it in your page, or you can try with jsonp
Uhm, if ALL it is would be an IMG tag, why aren't you just using an IMG tag? Well, unless you want to rotate the image, but even then I'd be just having a script that pulls a AJAX request of the relevant information (image url, alt text, and you probably have a href for an anchor around it?) and plug it in that way on the DOM.
AJAX looks like the only solution for your problem like deathshadow said. Here is the working example in csstricks site. https://css-tricks.com/ajax-load-container-contents/
You can try to use the object tag. example: <object width="100%" height="400px" data="URLHERE"></object> This does the trick most of the time, however, it is not perfect. I have tried many options before and have learned that including external pages is too much of a hassle in terms of cross-browser compatibility and functionality. And last but not least google hates it.
Jquery Ajax will not let you retrieve from a different domain (URL). However you could code a CGI script on your server (under your domain) to respond to your Jquery Ajax request. This CGI script would use cURL to retrieve the webpage from the external website, returning the raw HTML to the Jquery /Ajax request. This would however result in hotlinking - the images would be loading from the external site and this may get you blocked by the external site.
Just worth mentioning... If you are not the site owner, you have to have permission. A lot of webmasters really do not like being framed on other sites and it is often in their terms of use.
I've used AJAX for the purpose of avoiding the <iframe> tag. That's proof that it can be done. If you want to grab data across domains, you can grab it on the server side using a simple HTTP client you create yourself. It's not difficult.
Ha, AJAX is for little girls. If you gather contents as a search engine spider would, and follow the best practices with copyright licensing, this shouldn't be an issue. I know how the cross-site thing works, and I have an easy workaround on several levels. Companies know that they can't have it both ways. They often rely greatly on search engine referrals to generate traffic, so naturally, they want their content indexed by search engines. This means that the search engine stores the files of the web page into its private memory, and hence copies them. There are potential copyright issues as a result, but there are things a webmaster can do to control how (well-behaved) HTTP clients index their data and present it to an audience of users. Can you file suit on a search engine for spidering your contents, regardless of best practices used? Yes, technically. Will you be successful in your suit? I don't know. It depends on the context. Not likely IMO. What I'm saying is that there is a grey area, especially regarding Internet media we all share so much of. Just by knowing a thing or two about how loopholes always exist in a web site's terms of service, you can get away with grabbing many things. If you're not sure, contact the media's owner and request written permission for license to disseminate their data for a link or often a small royalty fee. Often, vendors are happy to allow you to use it for free. Now, I could say if you were taking someone else's content and claiming it as your own, that's an entirely different story. That's as in-depth as I can get without knowing any specifics of an organization's digital marketing model.