facebook

Actions Run JavaScript Not Working

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #342841 Reply

    Version details 2.3.2(hot-fix 1, 20130425)

    I have tried many different JS scripts posted in the forums for doing various actions. Going back, going forward, opening a URL and none will work. Not even if i write the function directly in the code pop up box or if i just call it and write the function in the Filename.JS file.

    Is there something else I need to do besides just call / write the JS function ?

    Page Architectural is set to Default
    File extension is set to HTML
    Java-script Libraries are are set to the default []
    Running this on windows 7 local hard drive environment.

    Please don’t ref mobione tutorial files as they are unhelpful as all the examples do not work when i copy and paste them into the pop up JS window box in any pages of the actions section.

    #342962

    Hi globalgraffiti,

    The examples aren’t wrong. You need to change some ids to make it work on a real project. Example:

    JavaScript Snippet: Get Text

    $('#form1-text1').text()

    JavaScript Snippet: Set Text

    $('#form1-text1').text('hello world')

    Note that the jQuery selector is: #form1-text1

    Mobione adds a prefix to your widgets elements in DOM by default, so for a text widget, let’s say text1 in a document called MyTest, the jQuery selector that you should use is: #m1-MyTest-text1

    So the snippets to set and get this text widget value are:

    JavaScript Snippet: Get Text

    $('#m1-MyTest-text1').text()

    JavaScript Snippet: Set Text

    $('#m1-MyTest-text1').text('hello world')

    For more details see WIDGET IMPLEMENTATION & JAVASCRIPT SNIPPETS section in MobiOne Widgets doc

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Actions Run JavaScript Not Working

You must be logged in to post in the forum log in