Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Twitter Sign In with OpenID Sign In with Google

Sign In Sign Up

In this Discussion

Tagged

Welcome to the Jo support forums! Please Sign Up and join in the discussion. You can also Sign In instantly with Twitter, OpenID or your Google ID.
can joFile get a html file from remote server ? and how to do ? can someone give me an example ?
  • cmlanchecmlanche July 2012
    Posts: 2
    var y = joFile("http://baike.baidu.com/view/5798116.htm",function(data,error){
    if( error ){
    alert( "error loading file" );
    return;
    }else{
    //alert("data getted:"+data);
    content_html.setData( data );
    }
     });
    I test it , it works, but data is zero , It is not I want , What I want is the some content of the html file.
  • davedave July 2012
    Posts: 415

    You might want to use joFileSource instead; it's a higher level data source class. An example can be found in jo/samples/file/file.js (also this working demo).


    You may also be running into cross-site security issues with your URL if it's hosted somewhere other than where your index.html was served, or some mobile OS' require your app to have special permission to do so. In general, I prefer jsonp to xmlhttprequest for that sort of reason.
    Dave Balmer, Jo Code Wrangler
  • xsnakedxsnaked July 2012
    Posts: 3

    hi cmlanche,


    how do you define content_html?

    this is my error
    TypeError: content_html is undefined"
  • cmlanchecmlanche July 2012
    Posts: 2

    content_html is a var of joHTML , defined in one joCard.