0

The following code is my attempt to pop up a message to any user visiting the page (Which is only for IE users).

<script src="jquery.reject.js"></script>
<script>
$(document).ready(function() {
    $.reject({  
        reject: { all: true },
        header: 'Internet Explorer is NOT Supported!',
        paragraph1: 'You will not be able to blah blah blah.',  
        paragraph2: 'Please choose one of the browsers below for this to function.',
        closeMessage: 'Note: You can still blah blah blah.'
    });      
    return false;  
});
</script>

What is wrong with the code? There are no syntax errors, but nothing happens when the page is loaded.

Thank you.

EDIT: Line 4, fixed to what it currently is. Still fails though.

5
  • I don't think you need to return false, but apart from that it looks okay (assuming that the plug-in itself advises that particular layout/functions and so forth. Commented Jan 4, 2012 at 0:03
  • Did the reject.js script get loaded properly? Commented Jan 4, 2012 at 0:04
  • <script src="jquery.reject.js"></script> Meaning that the file is in the same folder as index.php? Which it is. Commented Jan 4, 2012 at 0:11
  • Are you importing the base jQuery library so the browser even knows what to do with $ ? Commented Jan 4, 2012 at 0:19
  • Also, I think Siku means, did you check the console to make sure the file is actually getting loaded? Commented Jan 4, 2012 at 0:30

2 Answers 2

1

I think you have a typo on line 4, you have "$jquery.reject" instead of "$.reject" or "jquery.reject"

EDIT: if someone ever gets here again, there were a couple things wrong with the origin post, first a typo, then a missing reference to jquery and then another missing reference to the CSS for the plugin.

Sign up to request clarification or add additional context in comments.

7 Comments

Are you loading both jquery and jquery.reject?
No, what I posted in my original post is exactly the beginning of the document. After that, it's just PHP.
You need to load jQuery before you load the plugin.
I was going after this: jreject.turnwheel.com/#demo2 I just enabled loading jQuery before the reject, and it works. But not correctly. Try for yourself using IE, at plz.re (Much different than the demo on that site.
I don't have IE on my machine (running Ubuntu), did you already added the CSS for the plugin? jreject.turnwheel.com/css/jquery.reject.css if not, the plugin might work but look totally weird.
|
0

jquery.reject.js is a jQuery plugin. You need to load jQuery first, for example:

<script src='http://code.jquery.com/jquery-1.7.1.min.js'></script>

1 Comment

I did, following the comment on the post below by LEOPiC, which is <script src="jquery-1.7.1.min.js"></script> currently. The page loads, the script fires, but it's not displayed correctly.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.