New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beta release - cannot run javascript using onclick?? #1887

Closed
stopsusa opened this Issue Jun 22, 2011 · 14 comments

Comments

Projects
None yet
7 participants
@stopsusa
  • My Profile
  • Worked without a problem in last alpha release

    <script type="application/x-javascript"> function my_profilel(ck_username, ck_member, get_profile ){ alert('testing my_profile onclick); } </script>

    Please advise

    Thanks - Any and all help appreciated

    @forrest

    This comment has been minimized.

    Show comment
    Hide comment
    @forrest

    forrest Jun 22, 2011

    This has broken a significant amount of my code. I'm replacing them all with a binding to the "vclick" event, but I'm not happy about this change.

    forrest commented Jun 22, 2011

    This has broken a significant amount of my code. I'm replacing them all with a binding to the "vclick" event, but I'm not happy about this change.

    @trainiac

    This comment has been minimized.

    Show comment
    Hide comment
    @trainiac

    trainiac Jun 23, 2011

    @forrest Agreed, I just changed all bindings to vclick and now my test Android (2.3) ajax navigation is broken. The vclick event is not being caught and the page is being requested as normal. Changing back to using click for everything. Let you know how it all goes.

    @forrest Agreed, I just changed all bindings to vclick and now my test Android (2.3) ajax navigation is broken. The vclick event is not being caught and the page is being requested as normal. Changing back to using click for everything. Let you know how it all goes.

    @trainiac

    This comment has been minimized.

    Show comment
    Hide comment
    @trainiac

    trainiac Jun 23, 2011

    I am finding a few problems in Android ajax navigation in 2.3 as of the Beta release. In order for ajax navigation to work consistently and to be able to use 'click' events you have to set $.mobile.useFastClick = false. Also look out for this guy, #1904.

    I am finding a few problems in Android ajax navigation in 2.3 as of the Beta release. In order for ajax navigation to work consistently and to be able to use 'click' events you have to set $.mobile.useFastClick = false. Also look out for this guy, #1904.

    @samspot

    This comment has been minimized.

    Show comment
    Hide comment
    @samspot

    samspot Jun 29, 2011

    Please see this thread for more info: http://forum.jquery.com/topic/beta1-onclick-does-not-work-on-iphone

    I'm personally finding that for links it only fails on iphones, and only when href='#'. However I did notice that onclick wasn't working for divs.

    samspot commented Jun 29, 2011

    Please see this thread for more info: http://forum.jquery.com/topic/beta1-onclick-does-not-work-on-iphone

    I'm personally finding that for links it only fails on iphones, and only when href='#'. However I did notice that onclick wasn't working for divs.

    @ghost ghost assigned jblas Jun 29, 2011

    @toddparker

    This comment has been minimized.

    Show comment
    Hide comment
    @toddparker

    toddparker Jun 29, 2011

    Contributor

    You can turn off $.mobile.useFastClick and your click events will work again, but there will be a delay on iOS and other touchscreen devices. Ideally, you'd switch to using vclick in your code to speed up the responsiveness.

    Contributor

    toddparker commented Jun 29, 2011

    You can turn off $.mobile.useFastClick and your click events will work again, but there will be a delay on iOS and other touchscreen devices. Ideally, you'd switch to using vclick in your code to speed up the responsiveness.

    @toddparker

    This comment has been minimized.

    Show comment
    Hide comment
    @toddparker

    toddparker Jun 29, 2011

    Contributor

    BTW - you need to use latest instead of beta 1 if you want to disable this feature.

    Contributor

    toddparker commented Jun 29, 2011

    BTW - you need to use latest instead of beta 1 if you want to disable this feature.

    @samspot

    This comment has been minimized.

    Show comment
    Hide comment
    @samspot

    samspot Jun 29, 2011

    I can confirm that turning off $.mobile.useFastClick does not affect this issue in beta1.

    samspot commented Jun 29, 2011

    I can confirm that turning off $.mobile.useFastClick does not affect this issue in beta1.

    @toddparker

    This comment has been minimized.

    Show comment
    Hide comment
    @toddparker

    toddparker Jun 29, 2011

    Contributor

    Did you try latest? There was an issue in beta 1 that made turning this off not work.

    Contributor

    toddparker commented Jun 29, 2011

    Did you try latest? There was an issue in beta 1 that made turning this off not work.

    @jblas

    This comment has been minimized.

    Show comment
    Hide comment
    @jblas

    jblas Jun 29, 2011

    Contributor

    @samspot

    How and when are you turning off $.mobile.useFastClick? There was a bug where toggling that option didn't do what it advertised. This is why Todd said you need to try the latest.

    Contributor

    jblas commented Jun 29, 2011

    @samspot

    How and when are you turning off $.mobile.useFastClick? There was a bug where toggling that option didn't do what it advertised. This is why Todd said you need to try the latest.

    @samspot

    This comment has been minimized.

    Show comment
    Hide comment
    @samspot

    samspot Jun 29, 2011

    No, I haven't tried it yet, and we're overbudget on our jquery mobile upgrade task, so we cannot afford to upgrade again at this time :(

    The workaround we found is working well enough for now:
    a href="javascript:void(0);" onclick="alert('goodbye');">Goodbye</a

    This works on all the devices we tested and doesn't require us to refactor existing javascript.

    Edit: Had to deform the a tag to keep markdown from making it an actual link

    samspot commented Jun 29, 2011

    No, I haven't tried it yet, and we're overbudget on our jquery mobile upgrade task, so we cannot afford to upgrade again at this time :(

    The workaround we found is working well enough for now:
    a href="javascript:void(0);" onclick="alert('goodbye');">Goodbye</a

    This works on all the devices we tested and doesn't require us to refactor existing javascript.

    Edit: Had to deform the a tag to keep markdown from making it an actual link

    @toddparker

    This comment has been minimized.

    Show comment
    Hide comment
    @toddparker

    toddparker Jun 30, 2011

    Contributor

    This is now fixed in master.

    Contributor

    toddparker commented Jun 30, 2011

    This is now fixed in master.

    @toddparker toddparker closed this Jun 30, 2011

    @ncomo11

    This comment has been minimized.

    Show comment
    Hide comment
    @ncomo11

    ncomo11 Aug 8, 2011

    Just replace href="#" with href="javascript:" , this will trigger the OnClick code.

    • Praveen

    ncomo11 commented Aug 8, 2011

    Just replace href="#" with href="javascript:" , this will trigger the OnClick code.

    • Praveen
    @toddparker

    This comment has been minimized.

    Show comment
    Hide comment
    @toddparker

    toddparker Aug 9, 2011

    Contributor

    using href="javascript:" isn't a recommended approach for a number of reasons, but it is especially bad because it breaks the PE approach.

    Contributor

    toddparker commented Aug 9, 2011

    using href="javascript:" isn't a recommended approach for a number of reasons, but it is especially bad because it breaks the PE approach.

    @ncomo11

    This comment has been minimized.

    Show comment
    Hide comment
    @ncomo11

    ncomo11 Aug 19, 2011

    Jqm beta2 is stable ... switch to beta2

    ncomo11 commented Aug 19, 2011

    Jqm beta2 is stable ... switch to beta2

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment