David Bourne

Q: What have they done to Javascript?

I've developed a good number of widgets for my iBooks using first Dashcode and now iAd Producer. Since upgrading to iAd Producer 5 I'm seeing some strange behavior. Possibly my original code but I don't know. I'm not sure how to ask for help. Code that worked before would run OK in Preview but after editing and even after restoring it doesn't work in Preview. The section that is giving me problems for now are within if statements. I have input from buttons determine the path to follow. I have answers output to text fields but they become empty.

 

Reading buttons with

if(this.outlets.select1.selected)

 

Setting output fileds with

this.outlets.aLabel.text = $a;

 

I'm able to set output fields but somewhere in the process the code gets lost and $a is empty instead of the expected.

 

Sorry I'm not able to be clearer

 

Any thoughts/comments/suggestions.

 

Thanks, David

Posted on Oct 19, 2014 11:04 AM

Close

Q: What have they done to Javascript?

  • All replies
  • Helpful answers

  • by markmalone,Solvedanswer

    markmalone markmalone Oct 19, 2014 2:31 PM in response to David Bourne
    Level 2 (210 points)
    Oct 19, 2014 2:31 PM in response to David Bourne

    $a? Are you using jquery?  Did you include it? Are there errors in the console?

     

    -Mark

  • by David Bourne,

    David Bourne David Bourne Oct 19, 2014 3:38 PM in response to markmalone
    Level 2 (366 points)
    Publishing
    Oct 19, 2014 3:38 PM in response to markmalone

    Thanks Mark. $a ;-) I have the same calculation on my course website as php. Thus the '$'. Up until now Dashcode and iAd Producer have been happy enough with $a and such. Hmm. It looks like $a variable names or identifiers have been valid for JavaScript and I didn't see anything from a quick look at the Apple iAd docs. Must be confusing it in some way.

     

    Also, using php I usually fly blind with write statements as my debugging tool. I had forgotten (if I knew) that iAd Producer had a debugger,/console under Web Inspector. I think I may have even used it with php... oh well. Too many languages (and now Swift ;-) that are too similar.

     

    I did a quick removal of all '$' from my code and it worked (once at least ;-)

     

    Haha, I had another look at the console and it was complaining about a missing variable. I had left off a $ from the front of a variable name in some added code... oh dear.

     

    Thank you so much for pointing out the console and giving me a fresh perspective. I was behaving so strangely...

     

    David