SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    Dec 2011
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    need help getting a function to work in IE8

    I am encountering problems with Internet Explorer 8 and was wondering if anyone might be able to help. More specifically, I have utilized some java code (that I picked up from one of the site point books) that is supposed to: allow or remove a message - (telling users who currently have their JavaScript disabled, that it needs to be turned on in order to utilize important website functions). The purpose of this being to have the message show up when a user has their browser's JavaScript disabled, but at the same time removing the message so it does not show up when a user's JavaScript is enabled.

    This being accomplished through the use of the code shown below.

    $('#nojava').remove();

    This aforementioned snippet of java code does work in Mozilla - but does not work in Internet explorer8 even though the JavaScript in that browser is in fact enabled (and certain other java functions do work). Was wondering if someone could provide guidance as to the best way of coding this function. I would really appreciate as detailed feedback (regarding the specific needed code) as you might feel so inclined to offer. Thanks.

    scotty58

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,729
    Mentioned
    104 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by scotty58 View Post
    Was wondering if someone could provide guidance as to the best way of coding this function.
    Normally that is a good way of coding the function.

    Is it possible to take a look at a page that allows us to experience the problem, so that the trouble and a potential solution may be found?
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Member
    Join Date
    Dec 2011
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for getting back to me. I'm not sure which page info you refer to in your post - but I assume you are asking about my: "javascript.js" page. If this is the case, the only code on that page relevant to the function I'm trying to achieve is:
    ~ $('#nojava').remove(); ~ (and I am using "core.js" as provided in one of the sitepoint books on java script and "jquery-1.4.min.js")
    As mentioned in my original post - this code works to remove the "java script needs to be enabled" message in mozilla - but not in IE(7 or 8). Let me know more specifically what I can provide for your complete understanding of this issue and I will provide it. Thanks.
    scotty58

  4. #4
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,729
    Mentioned
    104 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by scotty58 View Post
    Let me know more specifically what I can provide for your complete understanding of this issue and I will provide it.
    There is nothing that seems to be wrong with the scripting code that you've shown to us here, which means that there is something else about the page that's responsible for the issue.

    A link to a web page that demonstrates the problem is the best thing that you can provide from here, so that we can diagnose the issue and come up with a solution.
    Last edited by paul_wilkins; Mar 20, 2012 at 22:18.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  5. #5
    SitePoint Member
    Join Date
    Dec 2011
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Though the site is unfinished and rough - you could see the issue to which I refer at: < www.assistedcare.org/index.php. >Thanks again for your help.
    scotty58

  6. #6
    SitePoint Guru
    Join Date
    Sep 2006
    Posts
    731
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you want to tell people to enable JavaScript, don't confuse them by referring to it as Java, which is something else entirely.

    There are indicated script errors that are probably the cause of your script not running. Use the error console.
    Tab-indentation is a crime against humanity.

  7. #7
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,729
    Mentioned
    104 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by scotty58 View Post
    Though the site is unfinished and rough - you could see the issue to which I refer at: < www.assistedcare.org/index.php. >Thanks again for your help.
    scotty58
    There are other scripting errors on your page, unrelated to what you posted about above, which are causing the scripting engine in IE8 to stop.

    Your nojava message is also incorrect. Java is a completely different language from JavaScript.
    Change your message to say JavaScript instead, otherwise you'll just end up confusing people.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

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