Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 15 of 15
  1. #1
    New Coder
    Join Date
    Feb 2010
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    javscript / jquery alert problem?

    Hi all,

    New to Javascript and really struggling to get this resolved. hope you folks can help.

    [background]
    On our home page http://www.data.org.uk there are three images under the heading "NEW! for members". When a user clicks on an image the should be prompted with an alert box asking if they wish to join or not, then, depending on what they click - "join" or "Not Now" - they should either be presented with a sample pdf - if 'not now' clicked - or the joining screen - 'join' clicked - where they obviously join and get the full version.

    [the problem]
    When a user clicks an image the entire screen freezes and the user is then no longer able to click any other menus. Instead a box appears at the bottom left of the screen. I really struggle with javascript so I'm having difficulty finding what the problem could be.

    [extra info]
    The site is made using joomla

    Any pointers as to what i should do / look for, would be a huge help.

    Please get in touch if you require more info / anything else.

    Kind regards
    MG

  • #2
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    Alerts and confirms should be used only in development for troubleshooting. If you need a user to make a choice, jQuery has a nice plugin called "reveal" that will slide a hidden div (that can contain just about anything) into view.
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • #3
    New Coder
    Join Date
    Feb 2010
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by WolfShade View Post
    Alerts and confirms should be used only in development for troubleshooting. If you need a user to make a choice, jQuery has a nice plugin called "reveal" that will slide a hidden div (that can contain just about anything) into view.
    Hi, thanks for your reply.

    Jquery is ace, but using it in Joomla 1.5 can be troublesome.

    The strange thing is that this problem almost seems to have come about over night. In that, it was working on our dev site, before i moved it to our live site. I backed up the code before making any changes. once i knew all was ok, i saved it, tested it once more to be sure, and then closed everything.

    I tested on the live site, and again it was all working, but then, having not worked with it for over a month or so, everything stops working.

    Regards
    MG

  • #4
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    Is it possible someone else made a change to code that might interfere with what work you did?
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • #5
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    2,981
    Thanks
    56
    Thanked 557 Times in 554 Posts
    Quote Originally Posted by mind_grapes View Post
    Jquery is ace, but using it in Joomla 1.5 can be troublesome.
    I guess the first question would be why are you using it then?
    <script src="http://code.jquery.com/jquery-latest.min.js" language="javascript" type="text/javascript"></script>
    the next one would be have you checked your error console?

    after that would come, do you really need browser detection? because that is what is breaking your code - jQuery pre-1.9 had a browser() method which has now been removed - being that your code loads the latest version of jQuery, it breaks itself. Solutions include writing your own browser sniffer, or including a previous version of jQuery that does include the browser() method

  • #6
    New Coder
    Join Date
    Feb 2010
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by WolfShade View Post
    Is it possible someone else made a change to code that might interfere with what work you did?
    Thanks for the reply.

    Possible, although I did just ask and they assure me they've not touched it.

    Regards,
    MG.

  • #7
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    xelawho has good points. Personally, I've heard about jQuery 1.9 and later having some issues, so I'm pretty much sticking with 1.8.x, myself.
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • #8
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,730
    Thanks
    6
    Thanked 1,018 Times in 991 Posts
    Also, it’s not advisable to automatically serve the latest version of jQuery (unless you can be sure that your scripts are always up-to-date and coded by the latest standards and best practices) because that’s what made your site break over night without any effort on your part. The next major version is version 2 which will drop support for IE 6–8 completely so if you continue to serve the latest version automatically then your site might break badly in those browsers (if you haven’t coded it properly using progressive enhancement).

  • #9
    New Coder
    Join Date
    Feb 2010
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the reply,

    It's been in place for years, and the company have had intermittent problems since. They're looking to move away from it, possibly to Umbraco in the near future.

    I've not checked the error console. In truth I don't know what to do - sorry, I'm rubbish i know. I'll have to read into it.

    You think by reverting that back to jquery 1.8 could solve the problem? I'll try it and see where it take me.

    Thanks to all for their help so far, really appreciate you folks taking time out to help me.

    Kind regards
    MG
    Last edited by mind_grapes; 04-08-2013 at 04:21 PM.

  • #10
    New Coder
    Join Date
    Feb 2010
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hi VIPStephan,

    Thanks for the links, i'll read into it.

    You make valid points re the most up to date version.

    Regards
    MG

  • #11
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    2,981
    Thanks
    56
    Thanked 557 Times in 554 Posts
    Quote Originally Posted by mind_grapes View Post
    You think removing that link to jQuery could solve the problem?
    NO!!!

    That will land you in way more trouble.

    Your easiest fix is to change that line to
    Code:
    <script src="http://code.jquery.com/jquery-1.8.3.min.js" type="text/javascript"></script>

  • #12
    New Coder
    Join Date
    Feb 2010
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    after that would come, do you really need browser detection? because that is what is breaking your code - jQuery pre-1.9 had a browser() method which has now been removed - being that your code loads the latest version of jQuery, it breaks itself. Solutions include writing your own browser sniffer, or including a previous version of jQuery that does include the browser() method[/QUOTE]

    Hi,

    I feel as if i should apologise before i write anything due to the lack of knowledge, but this browser detection, is it for checking in ie7. this bit:

    /***************************************** IE7- Message ***************************************************/

    function warning(){

    if(!$_SESSION['warning']){

    echo"


    and so on...

    Regards
    MG

  • #13
    New Coder
    Join Date
    Feb 2010
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by xelawho View Post
    I guess the first question would be why are you using it then?


    the next one would be have you checked your error console?

    after that would come, do you really need browser detection? because that is what is breaking your code - jQuery pre-1.9 had a browser() method which has now been removed - being that your code loads the latest version of jQuery, it breaks itself. Solutions include writing your own browser sniffer, or including a previous version of jQuery that does include the browser() method
    Quote Originally Posted by xelawho View Post
    NO!!!

    That will land you in way more trouble.

    Your easiest fix is to change that line to
    Code:
    <script src="http://code.jquery.com/jquery-1.8.3.min.js" type="text/javascript"></script>

    Hello,

    ARGH!!!!! sorry, Like i said im rubbish
    I did it at first and then changed it back. I always work on the test site first. thats the one thing i have learnt.

    It has worked thank you You folks always come through, and im forever thankful.

    I simply couldn't work out why it might have stopped working over night. What made you folks realize it was that straight away? experience or following the chain?

    Regards
    MG

  • #14
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    2,981
    Thanks
    56
    Thanked 557 Times in 554 Posts
    the error console was the first clue

    the second was that there have been a few similar questions lately, from people loading the latest jQuery and their code just stopped working overnight.

    glad you got it working

  • #15
    New Coder
    Join Date
    Feb 2010
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks to you folks!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •