JavaScript - Find Isp Of Visitor Using Javascript
Hello,
I have recently started a website which tells visitor's IP address, location and others details. I want to add some more functions to it. I found no way to detect visitors Internet Service Provider (ISP) using PHP. I would like to know if there is any way to do so in Javascript. Click the below link to view the site: Show IP Please help me ASAP. Regards, Wasif K. Similar TutorialsMy page has a form which has some sections that do not show unless needed, but if JS is turned off then these section will never show, so looking for a way to test if it is on or not and if not allow the page to display everything that would normally be hidden unless needed.
Hi, I'm using javascript in addition to a web service (BTBuckets) to display different content to visitors based on actions they take on my site. The javascript is working fine, but I noticed that if I simulate BTBuckets being disabled using Firefox Adblock none of the content shows up. So in the off chance of the service going offline it'll leave some pretty funky holes in the my content. I tried <noscript> tags which works with javascript off, but the content is still blank when I disable BTBuckets. I'm wondering if there's a way to display the default content if the service is unavailable? Here's the code I'm using: In the head: Code: <script type="text/javascript"> //<![CDATA[[ $BTB={s:XXXXX}; $BTB.jsh="http://static.btbuckets.com/bt.js"; //]]> </script> <script type="text/javascript"> document.write(unescape("%3Cscript src='" + $BTB.jsh.replace(/(https?:)/i,document.location.protocol) + "' type='text/javascript'%3E%3C/script%3E")); </script> The code in the body used to replace an image depending on visitor behavior: Code: <script type="text/javascript"> var _t = ""; if ($BTB.clusters["ppc_visitors"]) { _t = "\"images/top-photo-tracking-number.jpg\" alt=\"Call Toll-Free: 1-800-XXX-XXXX\">"; } else { _t = "\"images/top-photo.jpg\" alt=\"Call Toll-Free: 1-800-XXX-XXXX\">"; } document.write('<img src= ' + _t ); </script> <noscript><img src="images/top-photo.jpg" alt="Call Toll-Free: 1-800-XXX-XXXX"></noscript> Hello, please tell me where can I find script visible on page www.frendzel.pl (Big picture changing every few second to another from the list on the left)
I have a problem finding Form in javascript. document.getElementById('MyForm'); return "HTMLUnknownElement". But if I add a dummy form previous for the one I actually want to find, then: document.getElementById('DummyForm'); returns "HTMLUnknownElement", and then document.getElementById('MyForm'); Returns "HTMLFormElement", that is what need. But this unknown element, the dummy form creates a lot of other problems with my site so this solution is no good for me. Why cant I find my Form? Thanks. Probably a trivial question, but after a quick search I could not find the answer. I link a .js file in my .html, the .js might be in the same directrory as the .html or somewhere else. within the .js file, I'd like to find out with which path the .js was loaded by the .html. So, if the .html contains Code: script src="path/here/there/myscript.js" type="text/javascript" I'd like to have a way, in the file myscript.js to gather "path/here/there/" How to do that? Thanks. Hi. I am very new to javascript, so I might not even be wording my question right, but I am going to try and be as concise and specific as possible. I am using jquery on my website- the galleria plugin- to make a slideshow. you can see the completed show he http://www.pauljameswilliams.com/demo2a.html This slideshow will be one of three on my website. Each slide show will opperate the same exact way.I have built in tabbed navifation, and the slideshows will all be accessable under the "portfolio" tab by clicking on their corresponding links. check out the site he http://www.pauljameswilliams.com/portfolio.html As it is I have one slideshow up, although not yet connected to the corresponding link, but the images won't load. My guess is that because the div tag is hidden that the contents don't load propperly and I need the contents to load when the corresponding div tag that it is contained in becomes visible but I don't know how to do that. this is the javascript that I have written to show/hide the <div> tags where the content will live. Three slide shows will live in content_2 and show/hide when the corresponding button is pressed. Code: function tabSwitch(new_tab, new_content) { document.getElementById('content_1').style.display = 'none'; document.getElementById('content_2').style.display = 'none'; document.getElementById('content_3').style.display = 'none'; document.getElementById('content_4').style.display = 'none'; document.getElementById(new_content).style.display = 'block'; document.getElementById('btn_1').className = ''; document.getElementById('btn_2').className = ''; document.getElementById('btn_3').className = ''; document.getElementById('btn_4').className = ''; document.getElementById(new_tab).className = 'current'; } thank you- I am really stuck. i promise, i am actually learning javascript, I'm not just trying to get other people to do my work for me. Hi all new guy on the block here, I've got a website, and I want to add a welcoming message which hovers on a certain part of the page which only loads for the visitor for the first time they login, and won't again(presumably cookies used). And says something like "adjust your settings here.." I don't want it to be an external popup but something that loads on the page in a certain area, defined by me (PX-pixle reference) I think i nutted something out in a bit of PHP, this is what i've got so far PHP Code: <?php if (firstLogin()){ genSpecial(***load jquerie or css etc***); } else{ genRegular(); } ?> can anyone help me figure out how to make this all work and load a box from jquerie or something similar? thanks David First off, I'm working with tumblr.com which allows Javascript, but not PHP embedded in the HTML pages. It strips them out. I want to be able to get the country code (us, ca, uk, etc.) when a visitor visits my webpage so I can provide links for their locale. I'm having a very hard time finding correct information with examples to get this working. There was some .js libraries out there, but they don't work properly and say I'm in CA when I'm in US, like the jsapi from Google. Is there a way to execute a .php script which would output the country code of the visitor and be able to read/capture this result within the Javascript? Thanks in advance. Edward Hello, I was wanting a message to be displayed if it is the visitors first time to the site. It will be a toolbar displayed at the top of the website, with links to FAQ's. Any method of display this is fine. Thanks I have this floating banner code and I want to show it once per visitor. How could I have it to show once per visitor? <style> #floating_banner_bottom { text-align: left; width: 00%; bottom: 00px; margin-bottom: 0px; height: 50px; position: fixed; z-index: 50; left: 0px; </style> <div id="floating_banner_bottom"> <!-- Button to Close Banner --> <a style="display:scroll;position:fixed;bottom:50px;left:0px"> banner code <br /> <div class="close"> <a href="#" onclick="document.getElementById('floating_banner_bottom').style.display='none';return false;"> <i style="font-family: Georgia,"Times New Roman",serif;"><span style="background-color: #999999; color: white; font-size: small;"></span></i> <center> <img border="0" width="20" height="20" src="http://lh5.ggpht.com/_9vgJ1nwu_xA/S1jSp2ZhA7I/AAAAAAAAB8A/2AEBd4mR9qA/x.png" /> </center> </a> </div> <a/> </a></a></div> <!-- End Here --> Hi everyone, Is it possible to determine at the startup of the page if the visitor is using a computer or a phone to access the site? I would like to make the intro process much better than a simple "click here for HTML version or click here for Flash version". I would like for it to simply redirect to the page I set it to go to depending on whether or not they're using a regular browser or a mobile browser. How would I go about this? Thank you all very much in advance. Friends, I am looking for a PHP or Java Script to integrete in a PHP CMS, that enables to Redirect to Another URL when the script sense that the visitor is going away from the page. (Hit back button, hit refresh button and so on....) It should be unblockable by browsers. May anyone suggest me one or share the codes. I will use it for personal purpose and not for comercial purpose at all. Thanks Hello, Anyone know how to pop-up image for visitor that visiting for first time? the pop-up image should be appears 30seconds then it will open new window tab with adress page that i have attached to image then after 30seconds the pop-up automatically close. thx Im trying to figure out how to create a light box that doesn't close to reveal the content on the website, unless the user fully completes atleast 2-3 CPA(Cost Per Action) offers that will pop up in the lightbox? i know how to make a lightbox with a plugin from wordpress, but I just don't know how to make it so it'll close when it figures out the user has completed the surveys/offers. Kind of like this but maybe smaller to show there is content/download link behind it, http://sharecash.org/download.php?file=1595911 Does any know a code or a site I can get that from?
I'm looking for code which does the following: When a visitor visits my website and clicks anywhere on the page, (regardless of where the mouse clicks) it will automatically redirect him to another site. I think an event listener might be a solution, but I'm not sure. Thanks a lot for any help on this If possible, I would like there to be a 2 second time delay before it does the redirection. I have merged two scripts to make a popup that comes up even if blocked, and is for first time visitor only (cookie). The problem is that the way I'm doing it, it might show one or more times to the visitor. I don't want that because it will be irritating and this is a high-priority client. I'm posting the whole script because I think the problem is calling the popup before checking the cookie, but not sure how to rearrange things. Also, I did search and found some good dhtml stuff but don't want to rewrite. This was supposed to be done last night so if I can fine tune this for now, I'll have time to rewrite something better (or at least play around with another script). Also, the popup refuses to come up in IE - I have IE6, but I detest IE and their site doesn't even load in it so whatever. I tested in FFox3, Opera 10 and Safari and it seems to work but like I say because of the onclick - it will load at any click until the user goes to a different page. I added a refresh in there but it just made things worse - too much going on for the user at that point. Thanks for any suggestions. I hope I've used the right tags for this. I've highlighted the stuff at the bottom that I think is where I need the most help. Here is the code: // added for popup -kk var expDays = 100; // number of days the cookie should last //var page = "only-popup-once.html"; //var windowprops = "width=300,height=200,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=yes"; var newwin = null; function openwin() { // window.location.reload(); var url = "/NEWSLETTER.html" try { if (newwin != null && typeof(newwin.location.href) != 'undefined') { newwin.location.href = url; } else { newwin = open(url, "Subscribe", "height=390,width=545,screenX=0,left=0,screenY=0,top=0,channelmode=0,dependent=0,directories=0,fulls creen=0,location=0,menubar=0,resizable=yes,scrollbars=0,status=0,toolbar=0"); } newwin.focus(); } catch (e) { newwin = open(url, "Subscribe", "height=390,width=520,screenX=0,left=0,screenY=0,top=0,channelmode=0,dependent=0,directories=0,fulls creen=0,location=0,menubar=0,resizable=yes,scrollbars=0,status=0,toolbar=0"); newwin.focus() } } function GetCookie (name) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) return getCookieVal (j); i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break; } return null; } function SetCookie (name, value) { var argv = SetCookie.arguments; var argc = SetCookie.arguments.length; var expires = (argc > 2) ? argv[2] : null; var path = (argc > 3) ? argv[3] : null; var domain = (argc > 4) ? argv[4] : null; var secure = (argc > 5) ? argv[5] : false; document.cookie = name + "=" + escape (value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : ""); } function DeleteCookie (name) { var exp = new Date(); exp.setTime (exp.getTime() - 1); var cval = GetCookie (name); document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString(); } var exp = new Date(); exp.setTime(exp.getTime() + (expDays*24*60*60*1000)); function amt(){ var count = GetCookie('count') if(count == null) { SetCookie('count','1') return 1 } else { var newcount = parseInt(count) + 1; DeleteCookie('count') SetCookie('count',newcount,exp) return count } } function getCookieVal(offset) { var endstr = document.cookie.indexOf (";", offset); if (endstr == -1) endstr = document.cookie.length; return unescape(document.cookie.substring(offset, endstr)); } function checkCount() { var count = GetCookie('count'); if (count == null) { count=1; SetCookie('count', count, exp); // window.open(page, "", windowprops); window.onclick = openwin; // window.location.reload(); } else { count++; SetCookie('count', count, exp); } } window.onload=checkCount; // end popup -kk Hi All, I have the date in 2009-10-24 format.can anyone tell how can I get the day of any particular date entered by user. Thanks in advance... function textSize(updown) { var size = Number(readCookie('user-font-size')); if (size == 0) { size = 12; // No Cookie, Set A Default Size Of 12px } size = size + Number(updown); // Adjust The Current Size if (size > 20) { size = 20; } // Stop At 13 if (size < 12) { size = 12; } // Stop At 10 writeCookie('user-font-size', size, 12); // Update The Cookie document.body.style.fontSize = size + 'px'; // Set The Users Text Size } function writeCookie(name, value, days) { if (days) { var date = new Date(); date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); var expires = '; expires=' + date.toGMTString(); } else { expires = ''; } document.cookie = name + '=' + value + expires; } function readCookie(name) { name += '='; var cs = document.cookie.split(';'); for (var i = 0; i < cs.length; i++) { var c = cs[i]; while (c.charAt(0) == ' ') { c = c.substring(1, c.length); } if (c.indexOf(name) == 0) { //-----------// return c.substring(name.length, c.length); // Gotcha // } //-----------// } //------------// return null; // Failed // } //------------ <img id="plustext" class="zoom-in" alt="Increase text size" src="Zoom-In-icon.png" onclick="textSize (2);" style="cursorointer" /> <img id="minustext" class="zoom-out" alt="Decrease text size" src="Zoom-Out-icon.png" onclick="textSize (-2);" style="cursorointer" /> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer vel fringilla arcu. Cras ullamcorper nunc ac sapien gravida ultrices. Curabitur mollis consectetur elit non tempus. Duis blandit luctus feugiat. Nullam eget tellus at quam dapibus tempus in scelerisque ligula. Phasellus turpis ante, tincidunt at aliquam vel, luctus vitae leo. Suspendisse dignissim vehicula est, ac dapibus justo pellentesque eu. </p> cheers hope thats enough code Ant. This is the script itself - no error messages are generated. Code: <script language="javascript" type="text/javascript"> function getXMLHTTPRequest() { try { req = new XMLHTTPRequest(); } catch(err1) { try { req = new ActiveXObject("Msxm12.XMLHTTP"); } catch(err2) { try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch(err3) { req = false; } } } return req; } var http = getXMLHTTPRequest(); function getCattle(animal_id){ var myurl = 'find_cattle.php'; var CattleValue=animal_id; var modurl= myurl+"?d="+CattleValue; **************the alert returns the correct value from my selection and after than nothing, I never get my alert from the response portion alert("Looking For "+modurl); ******* http.open("GET", modurl, true); http.onreadystatechange=useHttpResponse; http.send(null); } function useHttpResponse(){ ************It never gets to this response alert("Made It To Response"); if (http.readyState == 4) { if(http.status == 200) { var ListValue = http.responseXML.getElementsByTagName("animal_id")[0]; document.getElementsById('cattle_data').innerHTML = animal_id.childNodes[0].nodeValue; } } } </script> thank you |