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

View previous topic View next topic 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 elementsdiv.listing lifrom a pagewww.domain.com/hello, that is different from my domain (so i cannot use .load()


What can I do?

Niko
Hyperactive

Male Posts : 2166
Reputation : 93
Language : English, French, Italian, Spanish, Latin

https://www.translationscloud.com/?utm_source=forumotion&utm

Back to top Go down

Re: Cross domain load request

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

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

SSYT
Forumember

Male Posts : 37
Reputation : 2
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

Niko
Hyperactive

Male Posts : 2166
Reputation : 93
Language : English, French, Italian, Spanish, Latin

https://www.translationscloud.com/?utm_source=forumotion&utm

Back to top Go down

Re: Cross domain load request

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

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

Please not ads Smile

SSYT
Forumember

Male Posts : 37
Reputation : 2
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:

Niko
Hyperactive

Male Posts : 2166
Reputation : 93
Language : English, French, Italian, Spanish, Latin

https://www.translationscloud.com/?utm_source=forumotion&utm

Back to top Go down

Re: Cross domain load request

Post by SSYT 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;
  }
  });
  });
})();

SSYT
Forumember

Male Posts : 37
Reputation : 2
Language : RO-10, EN-3, FR-1
Location : Romania

http://help.forumgratuit.ro/forum

Back to top Go down

View previous topic View next topic Back to top


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