trigger.io amber problem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

trigger.io amber problem

Jacob Wagner
  I tried using trigger.io with amber.  It worked on the first try: I got the amber browser running right away on my phone!

Now I am testing some apps with socket.io and pharo webclient, but I've run into a basic error with loadAmber used within trigger.io:

  here is my loadAmber call in index.html:
  <script type="text/javascript">
loadAmber({
               files: ['paper.js', 'Ludus.js' , 'Ludus-Examples.js' , 'AFI.js', 'HackerGame.js', 'Morphic.js', 'TB-Morphic.js', 'WebChessBoard.js', 'SubPilotPaper.js'],
               prefix: './',
  ready: function() {
$(function() {
smalltalk.ChessManager2._start();
});
      }});
</script> 

  ChessManager2 is defined in "WebChessBoard.js". However when the app runs it says that ChessManager2 is undefined.  This code works correctly when run from the browser with the same files as I'm using in trigger.io. However on the phone it fails.  

  I also tried loading WebChessBoard.js in a <script> tag in the document's <head> tag, however then "smalltalk is undefined".  

  Any ideas why this isn't working?  It appears the loadAmber doesn't work properly with trigger.io.
  

  
<zenchess@gmail.com>
Reply | Threaded
Open this post in threaded view
|

Re: trigger.io amber problem

xekoukou
Maybe this is entirely irrelevant but when you get undefined messages, I would be really careful how I pass objects from one place to the other, especially javascript objects. Be carefull how you inline javascript code as well.

2012/7/13 Zenchess [via Smalltalk] <[hidden email]>
  I tried using trigger.io with amber.  It worked on the first try: I got the amber browser running right away on my phone!

Now I am testing some apps with socket.io and pharo webclient, but I've run into a basic error with loadAmber used within trigger.io:

  here is my loadAmber call in index.html:
  <script type="text/javascript">
loadAmber({
               files: ['paper.js', 'Ludus.js' , 'Ludus-Examples.js' , 'AFI.js', 'HackerGame.js', 'Morphic.js', 'TB-Morphic.js', 'WebChessBoard.js', 'SubPilotPaper.js'],
               prefix: './',
  ready: function() {
$(function() {
smalltalk.ChessManager2._start();
});
      }});
</script> 

  ChessManager2 is defined in "WebChessBoard.js". However when the app runs it says that ChessManager2 is undefined.  This code works correctly when run from the browser with the same files as I'm using in trigger.io. However on the phone it fails.  

  I also tried loading WebChessBoard.js in a <script> tag in the document's <head> tag, however then "smalltalk is undefined".  

  Any ideas why this isn't working?  It appears the loadAmber doesn't work properly with trigger.io.
  

  



If you reply to this email, your message will be added to the discussion below:
http://forum.world.st/trigger-io-amber-problem-tp4639771.html
To start a new topic under Amber Smalltalk, email [hidden email]
To unsubscribe from Amber Smalltalk, click here.
NAML



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

Reply | Threaded
Open this post in threaded view
|

Re: trigger.io amber problem

Andrew McQuiggin
In reply to this post by Jacob Wagner

Hi Zenchess,

Are you using an Android device? Mine worked fine initially with Amber using PhoneGap or better, Trigger.IO.

But then my Android device got upgraded from 2.2 to 4.0.3 and all my Amber apps stopped loading.

I found the problem is that Android 3+ will not allow file: loads with query strings (which Amber uses). It does allow query strings over http:.
I understand the guys at Trigger.IO will soon make their local JS load into the WebView happen by http, which will fix this problem.

Andrew

On Jul 13, 2012 12:42 PM, "Zenchess" <[hidden email]> wrote:
  I tried using trigger.io with amber.  It worked on the first try: I got the amber browser running right away on my phone!

Now I am testing some apps with socket.io and pharo webclient, but I've run into a basic error with loadAmber used within trigger.io:

  here is my loadAmber call in index.html:
  <script type="text/javascript">
loadAmber({
               files: ['paper.js', 'Ludus.js' , 'Ludus-Examples.js' , 'AFI.js', 'HackerGame.js', 'Morphic.js', 'TB-Morphic.js', 'WebChessBoard.js', 'SubPilotPaper.js'],
               prefix: './',
  ready: function() {
$(function() {
smalltalk.ChessManager2._start();
});
      }});
</script> 

  ChessManager2 is defined in "WebChessBoard.js". However when the app runs it says that ChessManager2 is undefined.  This code works correctly when run from the browser with the same files as I'm using in trigger.io. However on the phone it fails.  

  I also tried loading WebChessBoard.js in a <script> tag in the document's <head> tag, however then "smalltalk is undefined".  

  Any ideas why this isn't working?  It appears the loadAmber doesn't work properly with trigger.io.
  

  
Reply | Threaded
Open this post in threaded view
|

Re: trigger.io amber problem

Andrew McQuiggin

The latest version of Trigger.io includes the http loading into the WebView, so worth giving it a try to see if that resolves the issue.

Andrew

On Jul 13, 2012 7:52 PM, "Andrew McQuiggin" <[hidden email]> wrote:

Hi Zenchess,

Are you using an Android device? Mine worked fine initially with Amber using PhoneGap or better, Trigger.IO.

But then my Android device got upgraded from 2.2 to 4.0.3 and all my Amber apps stopped loading.

I found the problem is that Android 3+ will not allow file: loads with query strings (which Amber uses). It does allow query strings over http:.
I understand the guys at Trigger.IO will soon make their local JS load into the WebView happen by http, which will fix this problem.

Andrew

On Jul 13, 2012 12:42 PM, "Zenchess" <[hidden email]> wrote:
  I tried using trigger.io with amber.  It worked on the first try: I got the amber browser running right away on my phone!

Now I am testing some apps with socket.io and pharo webclient, but I've run into a basic error with loadAmber used within trigger.io:

  here is my loadAmber call in index.html:
  <script type="text/javascript">
loadAmber({
               files: ['paper.js', 'Ludus.js' , 'Ludus-Examples.js' , 'AFI.js', 'HackerGame.js', 'Morphic.js', 'TB-Morphic.js', 'WebChessBoard.js', 'SubPilotPaper.js'],
               prefix: './',
  ready: function() {
$(function() {
smalltalk.ChessManager2._start();
});
      }});
</script> 

  ChessManager2 is defined in "WebChessBoard.js". However when the app runs it says that ChessManager2 is undefined.  This code works correctly when run from the browser with the same files as I'm using in trigger.io. However on the phone it fails.  

  I also tried loading WebChessBoard.js in a <script> tag in the document's <head> tag, however then "smalltalk is undefined".  

  Any ideas why this isn't working?  It appears the loadAmber doesn't work properly with trigger.io.