The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Cross domain load request

Go down

Cross domain load request

Post by Niko on May 23rd 2014, 11:45 pm

Hello mates

I would like to load on my forum portal (in a widget for example) a div class of another page

for example I want to load on my forum the elements div.listing li from a page www.domain.com/hello, that is different from my domain (so i cannot use .load()


What can I do?
avatar
Niko
Hyperactive

Male Posts : 2299
Reputation : 98
Language : English, French, Italian, Spanish, Latin

Back to top Go down

Re: Cross domain load request

Post by Apollo 2.0 on May 24th 2014, 7:23 am

.load not allow to loading elements other domain..
trying $.get() or $.ajax() Smile
avatar
Apollo 2.0
Forumember

Male Posts : 54
Reputation : 6
Language : RO-10, EN-3, FR-1
Location : Romania

http://help.forumgratuit.ro/forum

Back to top Go down

Re: Cross domain load request

Post by Niko on May 24th 2014, 1:23 pm

yes, I know I should use ajax, but I cannot understand how to set up the code pale
avatar
Niko
Hyperactive

Male Posts : 2299
Reputation : 98
Language : English, French, Italian, Spanish, Latin

Back to top Go down

Re: Cross domain load request

Post by Apollo 2.0 on May 24th 2014, 9:37 pm

Try:
api.jquery.com/jQuery.getJSON/
api.jquery.com/jQuery.Ajax/

Please not ads Smile
avatar
Apollo 2.0
Forumember

Male Posts : 54
Reputation : 6
Language : RO-10, EN-3, FR-1
Location : Romania

http://help.forumgratuit.ro/forum

Back to top Go down

Re: Cross domain load request

Post by Niko on May 25th 2014, 10:50 am

actually i know I have to use ajax.. but I don't understand how to set it.... :rose:
avatar
Niko
Hyperactive

Male Posts : 2299
Reputation : 98
Language : English, French, Italian, Spanish, Latin

Back to top Go down

Re: Cross domain load request

Post by Apollo 2.0 on May 25th 2014, 4:00 pm

An exemple ofer by api.

HTML:
Code:
<div id="images"></div>

JS:
Initialize resource of external pages.
Code:
(function() {
  var flickerAPI = "//api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?"; // External link
// Initialize
  $.getJSON( flickerAPI, {
    tags: "mount rainier",
    tagmode: "any",
    format: "json"
  })
    .done(function( data ) {
      $.each( data.items, function( i, item ) {
        $( "<img>" ).attr( "src", item.media.m ).appendTo( "#images" );
        if ( i === 3 ) {
          return false;
        }
      });
    });
})();
avatar
Apollo 2.0
Forumember

Male Posts : 54
Reputation : 6
Language : RO-10, EN-3, FR-1
Location : Romania

http://help.forumgratuit.ro/forum

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum