Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Thread: Can I use external HTML?

  1. #11
    Sencha User
    Join Date
    Feb 2012
    Posts
    49
    Vote Rating
    0
      0  

    Default

    this was the main homepage of the get started app in the sample tutorial
    this is in the Main.js file

    i wanted to replace the html there just as a test to see how it came out
    i didn't think it would matter?

    omar.html is a file that is currently in the same directory as the index.html

    let me know where i'm going wrong

    thanks

  2. #12
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    So your GS.view.Home class is in app/view/Main.js? If so then that is a problem, it should be in app/view/Home.js or rename GS.view.Home to GS.view.Main
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #13
    Sencha User
    Join Date
    Feb 2012
    Posts
    49
    Vote Rating
    0
      0  

    Default

    awesome! thank u
    it's working now!

    need some advice on the layout and content...

    - i've put the html file in a directory called 'myresources'
    - i then added an image. the console gave an error saying that it could find the image
    - i had to explicitly give the path myresources/image.jpg - but then the html file doesn't show the image when looked at just on its own
    what can i do to solve this problem?

    - i've got one line of text and below it i've put an image
    - i've tried a few things and the image always overlaps the bottom half of the text
    - what's the best way of controlling the layout?
    - use css? are there any conflict issues with sencha css i need to be concerned with?

    lastly: can you give some guidance of what i need to do to pull in a php file from a server?

    the spec for Ext.Ajax mentions: // process server response here

    what kind of response should i give

    ALSO: will i have similar problems accessing images and CSS on a page pulled in from an external page?

    i tried putting in an external page and got the following message:


    [COLOR=red !important]XMLHttpRequest cannot load http://www.html5rocks.com/en/tutoria...ache/beginner/. Origin http://localhost is not allowed by Access-Control-Allow-Origin.[/COLOR]
    what should i be doing here?

    thanks a million for the help so far

  4. #14
    Sencha User
    Join Date
    Feb 2012
    Posts
    49
    Vote Rating
    0
      0  

    Default

    EDIT: i've just read up about CORS
    is this something i need to be worried about?

    what i wanted: to create several static pages. deploy this as a native app - made with sencha or phonegap
    AND: have some pages that have their content hosted on a single domain - these pages would typically have dynamic content that can change

    this is not the same as having one of my pages on my server trying to access the contents of another domain (at least its the way i see it)

    let me know what u think
    thanks

  5. #15
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    If the app was hosted on one origin and the static pages on another then yes you would need CORS. Native wrappers don't have this restriction so you shouldn't need CORS.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  6. #16
    Sencha User
    Join Date
    Feb 2012
    Posts
    49
    Vote Rating
    0
      0  

    Default

    thanks for clearing that up - good to know that i don't have to worry


    just 2 last minor things mentioned above i was hoping you could answer:


    i need some advice on the layout and content...


    - i've put the html file in a directory called 'myresources'
    - i then added an image. the console gave an error saying that it could find the image
    - i had to explicitly give the path myresources/image.jpg - but then the html file doesn't show the image when looked at just on its own in a browser
    what can i do to solve this problem?


    - i've got one line of text and below it i've put an image
    - i've tried a few things and the image always overlaps the bottom half of the text
    - what's the best way of controlling the layout?
    - use css? are there any conflict issues with sencha css i need to be concerned with?

    thanks

  7. #17
    Sencha User
    Join Date
    Feb 2012
    Posts
    49
    Vote Rating
    0
      0  

    Default

    just following up last message above... any thoughts?
    i can find workarounds - but everything will be a hacked solution - i'd rather know what the proper way was
    thanks

  8. #18
    Sencha User
    Join Date
    Apr 2012
    Posts
    57
    Vote Rating
    1
      0  

    Default

    HI omarm ,

    can you please share your code of the same in zip . I am looking for the same. It will help me out for my work as well. To used external HTML in ST2.

Page 2 of 2 FirstFirst 12

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •