Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Make JSONP call using jQuery in Dynamics CRM

Posted on by Microsoft Employee

Hi,

I am working on cross domain calls in Dynamics CRM. I am testing one of the tutorial available on the web that says how to make cross domain calls. This is first time I am working on cross domain calls from CRM.

I create the Java Script file and insert function callTheJsonp().

Then create HTML web resource and  call the function from there.

But when page load it just shows the text i.e.

cross-domain.JPG

Code:

<HTML><HEAD><TITLE></TITLE>
<SCRIPT src="servername/.../jquery1.7.2.js"></SCRIPT>

<SCRIPT type=text/javascript>

function callTheJsonp()

{

//debugger;

// the url of the script where we send the asynchronous call 

//var url = "openexchangerates.org/.../latest.json";

jQuery.getJSON("api.twitter.com/.../user_timeline.json", { include_entities: "true", include_rts: "true", screen_name: "edwardsdna" },
 function(data) {
   alert(data[0].text);
});


}

} </SCRIPT>

<META charset=utf-8></HEAD>
<BODY onload=callTheJsonp() contentEditable=true>hey hey</BODY></HTML>

I am new to the cross domain can anyone please help me to sort out.

Thanks in advance

*This post is locked for comments

  • Verified answer
    ntn32 Profile Picture
    ntn32 401 on at
    RE: Make JSONP call using jQuery in Dynamics CRM

    Hi Jibi,

    It seems that you has pasted the code in HTML Web Resource editor's "Rich Text" instead of "Source".

    Whatever you paste in the rich text box, it will show you the same on load of the web resource.

    Pasted the code in "Source" text box.

    0654.3.PNG

    Then, click on "Rich Text" tab, you will be able to see the rendered result.

    0654.3.PNG

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Make JSONP call using jQuery in Dynamics CRM

    First of all make sure you created a correct type for the web resource, it has to be HTML. Then you put the URL of the web resource into the IFRAME. Something must be wrong somewhere, just go through the checking again.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Make JSONP call using jQuery in Dynamics CRM

    This is odd. Did you select the web resource type as HTML? Because this is the only reason in my mind that its showing html as text.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans