Click here to Skip to main content
15,885,309 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
I have a small data which retrive employee details in json. i have created a gadget. when i run the html page the data is shown in webpage. Whereas the code created to gadget it was unable to load jquery service reference.


JavaScript
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
   <script type="text/javascript">
       function DoInit() {
           Get_Indus_Widget();
       }
       //document.onload = init();
       //function init() {
       //    Get_Indus_Widget();
       //}
       function Get_Indus_Widget() {
        $("#tbDetails").append("Started request for data");}
Posted
Comments
Not clear. Can you create a jsfiddle to demonstrate what you are saying?
Ambati Dilip 10-Feb-15 3:36am    
http://jsfiddle.net/pbt4y4tj/5/

check this

See how it is working - http://jsfiddle.net/taditdash/3xebnn1f/[^].
 
Share this answer
 
Comments
Ambati Dilip 10-Feb-15 5:38am    
Yes it working, when i create a gadget with this html page i am getting

Loaded Javascript
Loaded Jquery b4 execute
Started request for data
Loaded after execution
Failed to load
undefined


Like this in the gadget what was the reason
Put a breakpoint inside the error method and try to see what is the error message. that would give u a hint.
Ambati Dilip 10-Feb-15 6:51am    
in browser its working. where in gadget its not working
What gadget? What is that exactly?
JavaScript
function DoInit() {
           $("#gadgetContent").append("<br />Loaded Jquery b4 execute");
           var xhr = new XMLHttpRequest();
           var requestUrl = "http://yourip:port/Webservice.asmx/yourmethod";
           xhr.open("GET", requestUrl, false);
           xhr.send(null);
           if (xhr.status == 200) {
               var image_url = xhr.responseText;
               $("#gadgetContent").append("<br /> Data is <br />" + image_url);
           }
           $("#gadgetContent").append("<br />Loaded after execution");
       }
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900