...

View Full Version : Calling/Invoking a Function



mnkhaki
11-22-2011, 01:03 PM
I hate IE. Its complicated and stubborn.

So I want visitors on our site to be redirected using a pop-up saying "you're using an unsupported browser". I found a great way to do this on the following site:

http://jreject.turnwheel.com/

I don't know much about JQuery - but I want to implement what this site offers on mine.

Would anyone be kind enough to explain how to get this done? In other words, do I save the file (code) in a separate file - and then "call" it from the index page? If yes, how?

My sites: www.jafferyacademy.org/index-beta.php and www.mombasajamaat.org/index-beta.php

VIPStephan
11-22-2011, 01:14 PM
You incude/call separate JS files with a script element, preferably in the document head but possible is anywhere in the document.


<head>


<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.reject.min.js"></script>

</head>


Be aware of the dependencies of the specific script.

mnkhaki
11-22-2011, 01:39 PM
Stephan - thank you.

I added the following as you suggested, uploaded the script in a separate .js file, but it didnt work. :(

Kor
11-22-2011, 01:55 PM
I hate IE. Its complicated and stubborn.

So I want visitors on our site to be redirected using a pop-up saying "you're using an unsupported browser".
I am not a MSIE fan, but what you intend to do is both silly and in loser. Like it or not, IE remains the main browser, with 54% of share market, which means you will loose half of the possible visitors for your site. After all, which people uses which browser is not your concern.

On the other hand, if you are coding carefully and, if necessary, you are using some simple cross-browser workarounds, you can create a site which should look and behave the same in all the browsers. No need for silly pop-up messages, nor for redirection toward separate web documents.



I don't know much about JQuery - but I want to implement what this site offers on mine.

If so, start learning how to use JQuery. Make sure you have learned JavaScript, first.

mnkhaki
11-23-2011, 05:39 AM
I am not a MSIE fan, but what you intend to do is both silly and in loser. Like it or not, IE remains the main browser, with 54% of share market, which means you will loose half of the possible visitors for your site. After all, which people uses which browser is not your concern.


Kor - thankfully we are not a business as such - just a school that has mainly parents & students visit the site. The pop up was intended to encourage chrome as a primary choice, but not make it mandatory.


On the other hand, if you are coding carefully and, if necessary, you are using some simple cross-browser workarounds, you can create a site which should look and behave the same in all the browsers. No need for silly pop-up messages, nor for redirection toward separate web documents.

I agree - I should be able to get that, but sometimes it just becomes annoying. Although, with the new web design, I do not seem to have much problem so I can see that having a pop up may not be necessary after all.


If so, start learning how to use JQuery. Make sure you have learned JavaScript, first.

Any (reliable) web tutorials you can recommend for javascript and jquery "lessons"?

Thanks again.

Kor
11-23-2011, 10:58 AM
http://www.w3schools.com/jquery/default.asp
http://docs.jquery.com/Tutorials
http://www.learningjquery.com/



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum