facebook

JavaScript’s .Click

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

    I’m using

    i.click(function(){

    }

    where the “i” variable is an image element so when the users click on this image it sets focus on that image.

    It seems to work fine in the MobiOne’s Test Center and in my desktop’s Chrome web browser (once it’s published as a web app).

    But once I connect to the app with my iPhone this function does not work.

    Please Help! Thanks!

    Robert

    #338216 Reply

    Hello….

    Anyone out there?

    #338222 Reply

    Brandon
    Member

    Is there a particular reason you are doing this instead of defining a typical function and assigning the image the function when clicked?

    #338265 Reply

    Hey Cincy,

    Yes, because this image is dynamic. This image gets copied onto a screen’s panel based on certain events. I use Raphael.js paper.set() for this panel and this paper.set contains images based on events. That’s why i use i.click as oppose to div with a OnClick parameter.

    Also on my previous e-mail I said, “once I connect to the app with my iPhone this function does not work.” … I have not built the iOS application yet…I’m running it as a web app on the Safari browser.

    Could this be because Safari does not support this function or maybe we need to download JQuery onto Safari? As I mentioned it works well from “Test Center” and Chrome once it’s published as a web app.

    Thank you and I’m looking forward to your reply.

    Robert

    #338347 Reply

    Hi Robert,

    Have you checked that you don’t have syntax errors? See the debugger section to learn about the javascript console in case you don’t know how to check these errors: http://www.genuitec.com/mobile/docs/testingAndDebugging/testingAndDebugging.html#debugger

    #338373 Reply

    Cincy,

    If I had syntax erros then it wouldn’t work on the MobiOne’s “Test Center” and my desktop’s Chrome browser, correct? It works without problem for both of these.

    My issue is it doesn’t work as a web app for the iPhone. I believe iPhone uses Safari.

    Please Help!

    Thanks.

    #338375 Reply

    Brandon
    Member

    Depending on the error it can work in the test center and browsers. I have had this happen before.

    #338376 Reply

    Cincy,

    Could there be a chance that the jQuery library needs to be downloaded and installed for the iPhone’s Safari web browser?

    Or Could it be it’s a web app and that once it’s built as a native app for the iPhone iOS it would work fine?

    Robert

    #338378 Reply

    Brandon
    Member

    The JQuery library is included when you publish the app, you can double check this by viewing the source code of the web add and checking for the line:
    <script type=”text/javascript” src=”res/jquery-1.8.3.min.js”></script>

    Does it show any error in the debugger?

    #338379 Reply

    Cincy,

    I ran the debugger and there were no errors.

    Any other causes?

    Robert

    #338380 Reply

    Brandon
    Member

    Do you have a url of the published project I can test it for you both in my browser and on my iPhone?
    If you dont want to post it here you can email it to me at info at cincyplanet dot com

    #338417 Reply

    Cincy,

    I’m running Debugger again.

    I have a .JS file I’ve created but I notice that it’s not listed on the drop-down listbox where all the other .JS files are, so therefore I cannot test it.

    My .JS is in the app-www directory.

    So why is it not listed there? Isn’t it suppose to be part of that list?

    Robert

    #338420 Reply

    Brandon
    Member

    Is it added as an addition project file?

    #338424 Reply

    Where and how do I check if it’s added as an additional project file?

    Robert

    #338489 Reply

    Cincy,

    I’m hearing the iPhone does not support OnClick? Is this true?

    Do you know if iPhone supports Rapahel.js’s .Click method?

    Thanks,

    Robert

Viewing 15 posts - 1 through 15 (of 20 total)
Reply To: JavaScript’s .Click

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