JavaScript - Can I Redirect Users If They Don't Have Js Enabled?
Hi,
I'm just wondering if I can do a check on my page to determine if users have javascript enabled, and if not, redirect them to a different webpage. My site requires javascript, and without it, all the jquery popup boxes and stuff overlap, so I'd rather the user just not see any of that at all. Similar TutorialsPerhaps this wouldn't even be Javascript, but here's my question. Is there a script that would direct Opera users past the front page of a web site (that uses flash) to the home page? For instance, a site I'm building as a favor to a church has a flash intro page that is fine with every browser but Opera. (Opera doesn't respond to Autoplay but places a large "Play" button where the flash is located.) On this particular page, the flash movie ends with an "Enter" instruction and is a hyperlink to the "home" page, so if an Opera user clicks that button, they're still not going to see the flash but are going to arrive at the "home" page. Is there a way to not even present them with the flash page, but to send them straight to the home page? I'd appreciate any assistance. I have a page up with an iframe that's approximately 300px by 405px. When I load up the site in FF and IE, it frames just fine. However, in Chrome and Opera the iframe is shifted upwards and is off-frame. I've tried looking for a solution to center the iframe correctly. Someone said to make a php code that loads 2 different iframes depending on browser (1 iframe for IE/FF and another frame for OP/CH). I have no knowledge of php coding, so I couldn't get it to work. So now, I think I'm limited to redirecting users based on browser type. If the user is using FF or IE, I'll redirect them to my original page. If they're using some other browser, I'll redirect them to a different page without the iframe. I've tried to set up a redirector, but it has trouble distinguishing between FF and Chrome. It treats them exactly the same. Does anyone have any advice on what to do? I've done tons of searching for what seems to be such a small problem. Someone please enlighten me. Hey guys, i'm trying to set up a favorite system for my website and I'm using ajax to do an async request to the server to run a php script. The problem is that i'm running joomla with sef enabled. So whenever i'm on a page the URL looks like: mysite.com/Category-Name/Item-Name/ when i click on the favorite button it will look like this mysite.com/Category-Name/Item-Name/favorite.php?all-the-stuff-that-is-being-sent-to-the-file This obviously doesn't work... I followed this tutorial: http://woork.blogspot.com/2007/10/in...sing-ajax.html My question is how do i fix this.. can i get the base URL or something? I am a TOTAL noob to javascript. i somewhat understand it, but i have no clue what i'm doing. I just have basic programing knowledge through MATLAB and PHP... BTW, the key here is not to leave the site Thanks for the help in advance EDIT added my domain name in front of the location of the file and fixed the problem =) The navigation for the web site I'm doing requires JS to remotely work so I want to make some kind of back-up scenario. Basicly, how can I make it so my main navigation will only display if there is script? One thought I had was put it in a div, hide it in the CSS, then use JS to show it but if there is a better way to do this I'd like to know. Hi all. This is a generic question as Google didn't help at all, does anyone know how to check if javascript is enabled and then I want to display info based on that. I don't mind how I do it, HTML, PHP or whatever Regards, Magnetica Hi all, The code I am working on uses the idea of detecting mime type support, to see if the add-on is there. Then if the mime type is not supported, it assumes, the add-on is not installed. (No other add-ons have this mime type.) However, there is a problem, if someone disables the add-on, the there is no mime type handler in navigator.mimeTypes['the/MimeType']. Is there some way to detect if an add-on is installed, and also if the add-on is enabled? Thanks, Grae Hi, I'm wanting to make a submenu appear on the page when a menu item is mouse-overed. I can find examples online where UL and LI are used, but that won't work in my layout: http://www.girlscoutsmoheartland.org/newpagetest.php Here, the menu items like "home" and "for girls" need to generate a horizontal submenu below where "menu item A" and "menu item B" are, and each submenu would appear in the same location as the other submenus, disappearing and appearing as a different menu item above is hovered over. All I can find are like this: http://htmldog.com/articles/suckerfish/dropdowns/ and I can't figure a way to conform that to this layout. Can someone point me to a site that has a solution for this situation? Thanks! Liam We all know AC_OETags.js. URL like: http://www.adobe.com/products/flashp...detection_kit/ How to make flash detection in variable with valu true or false if it is (not) detected to use in PHP applications? I have an auto submit form example.. Code: <form name = "backtosource" method="POST" and the rest of this is fine> blah blah </form> <script type="text/javascript"> function process_data_return() { document.backtosource.submit(); } </script> <script type="text/javascript"> <!-- process_data_return(); // --> </script> so this works for everyone of my people other than one who is on a debian server, we all use centos. i know this is cleint side but i wanted to mention that. this user has the js enabled on all his browsers. so what would cause his browser not to execute the js auto submit, we know this to be the issue but cannot resolve. thanks i guess i could try the old cdata wrap trick Code: // <![CDATA[ js code // ]]> but i dont want it to affect those that this is working. What is a good switch value to use so i can build an if statement. Is there a current local value i can trap for comparison Hi all, I am writing an administration panel for a web site. I want to check if the client's browser javascript enabled and if it is not enabled, a warning DIV comes telling the client to enable javascript and disable the actual page (make the actual page non-usable). Is there a way to do that? Thanks in advance telmessos Hello, I would like to know how to make a website (in this case, a parent div) viewable only if JavaScript is enabled? I tried to develop a code that can do this, but could not find the solution. Code: <html> <head> <script type="text/javascript"> window.onload=function() var="true" if(JavaScript.enabled) { document.getElementById('true') } OnClick() {document.getElementById('toggle').onclick=function() {document.getElementById('jahava').style.display=(document.getElementById('jahava').style.display!='none')?'none':'';}} </script> </head> <body> <noscript>You must have JavaScript enabled to view the website.</noscript> <div id="jahava">Contents Here</div> </body> </html> Hi, a friend of mine has a problem on several (German) Legend of the Green Dragon (lotgd) servers. Sometimes, mostly after she has loged in and out for a few times during a day, she suddenly gets the message that Javascript must be enabled to log in. But it definetely IS enabled - otherwise she'd never be loged in! The error occurs - on 2 different PCs - with 2 different internet providers - with IE, FF and Opera - only on lotgd servers - any other page using Javescript are working fine We - updated and downgraded Javascript - disabled and/or uninstalled all antivirus and firewall programms - cleaned cache with CCleaner - disabled browser add ons - reinstalled Windows - disabled auto-insert passwords Even a reboot doesn't change anything. Sometimes, when she waits a few hours, she can log in again. Sometimes the error doesn't occur for days, sometimes it's there every day. That's why it is so strange. Although she doesn't change anything, the error comes and goes completely irregular. The games' admins can't or don't want to help, they say that she's the only one with that problem and that it's not a mistake in the script. What might occur that error? And what can we do to stop it?? That's what the Opera error console says: JavaScript - http://lotgd.demonstone.org/index.php Inline script compilation Syntax error at line 21 while loading: b|(~d)),a,b,x,s,t);}*/ --------------------^ expected expression, got '*' CSS - http://lotgd.demonstone.org/templates/yarbrough.css Linked-in stylesheet xbackground-color is an unknown property Line 1: eight:auto;padding:1px;line-height:18px;float:left;clear:none;xbackground-color: --------------------------------------------------------------------------------^ JavaScript - http://lotgd.demonstone.org/index.php Inline script compilation Syntax error at line 21 while loading: b|(~d)),a,b,x,s,t);}*/ --------------------^ expected expression, got '*' JavaScript - http://lotgd.demonstone.org/index.php Uncaught exception: ReferenceError: Undefined variable: calcMD5 Error thrown at line 1, column 0 in <anonymous function>(event): document.forms.loginform .hidden_pw.value = calcMD5(document.forms.loginform .password.value); JavaScript - http://lotgd.demonstone.org/index.php Inline script compilation Syntax error at line 21 while loading: b|(~d)),a,b,x,s,t);}*/ --------------------^ expected expression, got '*' JavaScript - http://lotgd.demonstone.org/index.php Uncaught exception: ReferenceError: Undefined variable: calcMD5 Error thrown at line 1, column 0 in <anonymous function>(event): document.forms.loginform .hidden_pw.value = calcMD5(document.forms.loginform .password.value); JavaScript - http://lotgd.demonstone.org/index.php Inline script compilation Syntax error at line 21 while loading: b|(~d)),a,b,x,s,t);}*/ --------------------^ expected expression, got '*' JavaScript - http://lotgd.demonstone.org/index.php Uncaught exception: ReferenceError: Undefined variable: calcMD5 Error thrown at line 1, column 0 in <anonymous function>(event): document.forms.loginform .hidden_pw.value = calcMD5(document.forms.loginform .password.value); JavaScript - http://lotgd.demonstone.org/index.php Inline script compilation Syntax error at line 21 while loading: b|(~d)),a,b,x,s,t);}*/ --------------------^ expected expression, got '*' I hope someone is able to help. Thank you! Either that or provide me with an alternative way of coding a web application in a browser. Suppose I create a nifty web application that runs in your browser for which there is currently high market demand, but for some reason competitors have all overlooked it. I am sure that if I simply implemented it in regular JavaScript for all to see, it would not be long before competitors catch on and steal the concept from me (loosely speaking, in a way that doesn't violate copyright). However, I can delay my competitors if I can find a way to conceal the code. But JavaScript is not readily concealable, and there are always simple ways to reveal it by common methods suggested by people. Is anybody clever enough to suggest a solution for me? Does someone know what the JavaScript for checking if an user have "liked" and "shared" on Facebook? As far as I know, you can not check if they've shared, but only if they've clicked the button. I don't know if you can make them like to view, but it would be nice to get that piece of code too, if obtainable. I'm going to use it for a website where you have to "like" a fb page shown, and have to share the website. If someone can provide it, I'd also like a guide on timers /foldager I was wondering, could you have more than one username and password for the Username and Password II script? and if so, could you tell me how?
I wish to have a user list updated every 20 seconds or so with the users that are still online. I have the time(); stored in the database with their usernames, how do i get this uaing JavaScript. I have a program written in Javascript (saved as an HTML file that I run from my desktop by launching it in IE) which works fine on my system. Running IE 8 in Vista on one system and XP on another. When I launch the file, I get warning in the information bar: "To help protect your security, Internet Explorer has restricted this webpage from running scripts or ActiveX cntrols that could access your computer. Click here for optons..." I actually WANT this warning. When I click through it to accept, the program works fine. But about half of the people that I share this program with are not getting this warning, and it appears that the javascript never runs. At first I thought it was something in Windows 7, because two of the users were running on that OS, and I've found a number of issues described online about having problems running scripts in IE8/Win7. But the latest user is also running Vista, like me. His security settings are set to the default, Medium-High. But he's still not getting the script/ActiveX warning in the message bar. Anyone know how we can enable that warning? Thanks! I frequent a forum that has a pretty large community. There are a few users there I don't particularly care for. I would like to make a Greasemonkey compatible javascript code that would allow me to completely erase their posts from the page. What I want to happen is that every time Code: <li class="kpost-username"> <a rel="nofollow" title="" href="/index.php/component/kunena/profile/userid-80?Itemid=0" class="kwho-user">Rolepgeek</a> </li> appears it deletes the parent <table class="kmsg"> node. I know that I can find each of those code snippets with Code: document.getElementById('kpost-usernmae') however I am not sure how I would go about defining if it includes Code: <li class="kpost-username"> <a rel="nofollow" title="" href="/index.php/component/kunena/profile/userid-80?Itemid=0" class="kwho-user">Rolepgeek</a> </li> or not, nor am I sure on how to tell the code to delete the parent <table class="kmsg"> node when it does include it. I've been messing around a bit with some code, and I understand the general idea of how it should work, however I do not know the syntax in order to get it to work. Any help would be appreciated. HTML to a full post: Code: <table class="kmsg"> <tbody> <tr> <td class="kprofile-top"> <ul id="kpost-profiletop"> <li class="kpost-smallicons"> <span title="Gender: Unknown" class="kicon-profile kicon-profile-gender-unknown"></span> <a title="Click here to send a private message to this user." href="/index.php/component/uddeim/?task=new&recip=80&Itemid=213"><span alt="Click here to send a private message to this user." class="kicon-profile kicon-profile-pm"></span></a> <br> <div> <span class="kpost-userposts">Posts:334</span> </div> </li> <li class="kpost-personal"> Chaos will consume all... </li> <li class="kpost-avatar"> <a rel="nofollow" title="" href="/index.php/component/kunena/profile/userid-80?Itemid=0" class="kwho-user"><span class="kavatar"><img style="max-width: 72px; max-height: 72px" alt="" src="http://thekingdomsmc.com/media/kunena/avatars/resized/size72/users/avatar80.jpg" class="kavatar vbavnparnxybaoekjwjh"></span></a> </li> <li class="kpost-username"> <a rel="nofollow" title="" href="/index.php/component/kunena/profile/userid-80?Itemid=0" class="kwho-user">Rolepgeek</a> </li> <li class="kpost-userrank"> Merchant </li> <li class="kpost-userrank-img"> <img alt="" src="http://thekingdomsmc.com/components/com_kunena/template/default/images/ranks/rank3.gif"> </li> <li><span class="kicon-button kbuttononline-yes"><span class="online-yes"><span>NOW ONLINE</span></span></span></li> <li class="kpost-karma"> <span class="kmsgkarma"> Karma: -9 <a rel="nofollow" title="" href="/index.php/component/kunena/4-off-topic/karma/userid-80?do=decrease&pid=13229&0409ea1d6b1360d1a0a24ee6206c0bf4=1&Itemid=0"><span title="Smite" border="0" alt="Karma-" class="kkarma-minus"> </span></a> <a rel="nofollow" title="" href="/index.php/component/kunena/4-off-topic/karma/userid-80?do=increase&pid=13229&0409ea1d6b1360d1a0a24ee6206c0bf4=1&Itemid=0"><span title="Applaud" border="0" alt="Karma+" class="kkarma-plus"> </span></a> </span> </li> </ul> </td> </tr> <tr> <td class="kmessage-top"> <div class="kmsgbody"> <div class="kmsgtext"> Yeah. And it would be pointless, seeing as how I won't. </div> </div> <div style="display: none" class="kreply-form" id="kreply13229_form"> <form enctype="multipart/form-data" name="postform" method="post" action="/index.php/component/kunena/post?Itemid=0"> <input type="hidden" value="13229" name="parentid"> <input type="hidden" value="4" name="catid"> <input type="hidden" value="post" name="action"> <input type="hidden" value="1" name="0409ea1d6b1360d1a0a24ee6206c0bf4"> <input type="hidden" value="Shigan" name="authorname"> <input type="text" value=" To all non-bronies." maxlength="50" class="inputbox" size="35" name="subject"><br> <textarea cols="60" rows="6" name="message" class="inputbox"></textarea><br> <input type="checkbox" value="1" name="subscribeMe"> <i>Check this box to be notified of replies to this topic.</i> <br> <input type="submit" title="Click here to submit your message" value="Submit" name="submit" class="kbutton kreply-submit"> <input type="reset" title="Click here to cancel your message" value="Cancel" name="cancel" class="kbutton kreply-cancel"> <small>Note: BBcode and smileys are still usable.</small> </form> </div> </td> </tr> <tr> <td class="kbuttonbar-top"> <div> <div class="kmsgsignature"> With Order, come entropy,<br> With Life, comes death,<br> With Light, comes shadow.<br> <br> <div style="text-align: center">If one does not know Chaos, one does not realize the potential within themselves.</div> </div> </div> <div class="kmessage-editmarkup-cover"> <span class="kmessage-informmarkup"><a rel="nofollow" title="" href="/index.php/component/kunena/4-off-topic/13229-re-to-all-non-bronies/report?Itemid=0">Report to moderator</a></span> </div> <div class="kmessage-buttons-cover"> <div class="kmessage-buttons-row"> <a id="kreply13229" rel="nofollow" title="Quick Reply" href="/index.php/component/kunena/4-off-topic/13229-re-to-all-non-bronies/post?do=reply&Itemid=0" class="kicon-button kbuttoncomm btn-left kqreply"><span class="reply"><span>Quick Reply</span></span></a> <a rel="nofollow" title="Reply" href="/index.php/component/kunena/4-off-topic/13229-re-to-all-non-bronies/post?do=reply&Itemid=0" class="kicon-button kbuttoncomm btn-left"><span class="reply"><span>Reply</span></span></a> <a rel="nofollow" title="Quote" href="/index.php/component/kunena/4-off-topic/13229-re-to-all-non-bronies/post?do=quote&Itemid=0" class="kicon-button kbuttoncomm btn-left"><span class="quote"><span>Quote</span></span></a> </div> </div> <div class="kpost-thankyou"> <a rel="nofollow" title="I want to thank you for this message!" href="/index.php/component/kunena/4-off-topic/thankyou?pid=13229&0409ea1d6b1360d1a0a24ee6206c0bf4=1&Itemid=0" class="kicon-button kbuttonuser btn-left"><span class="thankyou"><span>Thank You</span></span></a></div> </td> </tr> </tbody> </table> I had a thread on here earlier in which one of you helped me immensely. As I mentioned in that thread, I know very little about javascript. The code I was given basically handles one user, and does it very well. I have since attended a meeting in which I was asked to have multiple users on one page. For example: My current code handles the following: Name - Hours - series of radio button choices. My updated request is the following: Name - Hours - series of radio button choices Name - Hours - series of radio button choices Name - Hours - series of radio button choices Name - Hours - series of radio button choices etc. up to 15 total users. I have tried to adjust the javascript, but with my lack of knowledge in this area I keep breaking it. Any help would again be greatly appreciated, here is my code: Code: <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Jared Daily Sales Goal Calculation Worksheet</title> </head> <script type="text/javascript"> var IE = navigator.appName == "Microsoft Internet Explorer"; var nSets = ""; var answeredQ = []; function advanceTo(nextQ,nQ){ var currAns = answeredQ[nQ.name.replace(/q/,"")-1]; if (currAns != "-" && currAns != nQ.value) { var nFloor = nQ.parentNode.parentNode.id.replace(/f/,"")-1; for (i=0; i<nSets.length; i++) { if (i > nFloor) { nSets[i].style.display = "none"; } } } nSets[nextQ-1].style.display = ""; answeredQ[nQ.name.replace(/q/,"")-1] = nQ.value; } function init(){ nSets = document.forms[0].getElementsByTagName('fieldset'); for (i=1; i<nSets.length; i++) { nSets[i].style.display = "none"; answeredQ[answeredQ.length] = "-"; } } IE ? attachEvent('onload', init, false) : addEventListener('load', init, false); </script> <style type="text/css"> body {background-color: #ffffff; margin-top: 60px;} fieldset {border: 0px} td { font-family:Arial, Helvetica, sans-serif; font-size:12px;} h1 { font-family:Arial, Helvetica, sans-serif; font-size:12px; font-weight:bold;} </style> <body> <cfform action="" method="post"> <!--- Header ---> <table border="1"> <tr> <td> <table align="left"> <tr bgcolor="#E5E5E5"> <td>Name</td> <td>Hours</td> <td colspan="4"></td> </tr> <!--- Emp 1 ---> <tr bgcolor="#ffffff"> <td valign="top"><input name="" size="10"></td> <td valign="top"><input name="" size="10"></td> <td valign="top"> <fieldset id="f1"> <!-- Question 1 --> <label><input type="radio" name="e1q1" value="Diamond1" onclick="advanceTo(2,this)">Diamond</label> <label><input type="radio" name="e1q1" value="Perimeter1" onclick="advanceTo(3,this)">Perimeter</label> </fieldset> </td> <td valign="top"> <fieldset id="f2"> <!-- Question 2 --> |<label><input type="radio" name="e1q2" value="GM1">GM</label> <label><input type="radio" name="e1q2" value="AGM1">AGM</label> <label><input type="radio" name="e1q2" value="DDM1">DDM</label> <label><input type="radio" name="e1q2" value="FT1" onclick="advanceTo(4,this)">Full Time</label> <label><input type="radio" name="e1q2" value="PT1" onclick="advanceTo(4,this)">Part Time</label> </fieldset> </td> <td valign="top"> <fieldset id="f3"> <!-- Question 3 --> <label><input type="radio" name="e1q3" value="PDM">PDM</label> <label><input type="radio" name="e1q3" value="RL">RL</label> <label><input type="radio" name="e1q3" value="FT1" onclick="advanceTo(4,this)">Full Time</label> <label><input type="radio" name="e1q3" value="PT1" onclick="advanceTo(4,this)">Part Time</label> </fieldset> </td> <td valign="top"> <fieldset id="f4"> <!-- Question 4 --> |<label><input type="radio" name="e1q4" value="Tenured1">Tenured</label> <label><input type="radio" name="e1q4" value="NonTenured1">Under 2 Years</label> </fieldset> </td> </tr> </table> </td></tr></table> </cfform> </body> </html> |