JavaScript - How To Block Ip's From Website Monitoring Software
We have live chat set up on our website. We can monitor visitors on the site and see what they are viewing and how long they've been there. The problem is that many people from our company are on the site, and we don't want them to show up in the visitor monitoring area.
Is there a way to add javascript that will block our own IP address from displaying in our visitor monitoring? The company we are paying for the live chat service doesn't have a solution for us. Thanks! Similar TutorialsHi There, I'd like to create a webpage which checks a few other webpages on different Words. For example my page, which automatically reloads every 30 seconds, checks if the words "fire", "tsunami","earthquake" exist on cnn.com or bbc.com. When it does, I want to see some text like "fire message on cnn.com". I already found a javascript on the codingforums, but this one only find text in it's own page, not on pages which I load in iframes. Could you please help me, I post part of the script (without the reloading part) underneath. --------------------------------------------- <script type="text/javascript" > var keywords=new Array(); keywords[0]="fire"; keywords[1]="tsunami"; keywords[2]="earthquake"; var len = keywords.length; var found = ["0","0", "0"]; </script> <body> <div id="navDiv" style="width: 99%; height: 20px; border: 1px solid #000000; text-align: center; position: absolute; padding-top: 10px;"> <script type = "text/javascript"> window.onload = function(){ var str = document.getElementsByTagName('body')[0].innerHTML; // strip all HTML tags out of that: // Thanks Old Pedant for the reminder! var zapRE = /\<[a-z][^\>]*\>/ig; str = str.replace(zapRE, ""); //str = str.toLowerCase(); // to make case insensitive for (var i = 0; i<len; i++) { str2find = keywords[i]; //str2find=str2find.toLowerCase(); // to make case insensitive var a = str.indexOf(str2find); if (a >= 0) { found [i] = 1; } } for (var i = 0; i<len; i++) { if (found[i] == 1) { alert ("There's some news about a " + keywords[i]); } } } </script> </div> <iframe id="frmMain" style="zoom:48%" frameborder="0" scrolling="no" width=25% height=48% src="http://www.bbc.com"> <iframe id="frmMain2" style="zoom:48%" frameborder="0" scrolling="no" width=25% height=48% src="http://edition.cnn.com"> </body> Just curious, what test case software have ya'll been using. Ive been using http://is.gd/h9SW1 this but were curious what others were using? It's pretty good btw, just curious what the rest of ya'll are doing for your testing process. Doesn't hurt to know all the resources that are out there, right!?
How would you Integrate 2 or more Software/Applications via API to build a New Membership Site Software? Also use FB, Twitter & G+ Authentication in addition to Registration via Email Address What is the Process like? What to look out for and how to Document the Workflow? I have to take more javascript programming classes and I'm really not good at it. I desperately need help. I own Visual Basic, but it's a little difficult to use. What is the best book, online resource, and software for programming in javascript?
is there a way using .htaccess or some other means that we can block certain websites from appearing when we do a google search of my wife's name? We contacted google and they denied our request to have these websites blocked. My wife has her own website she uses for her business. There was an .htaccess editor website that I visited that created the code after I specified the url of the websites we wanted blocked. Will this work and if so, after creating the .htaccess file what do I do with it, that is where do I attach it/post it? please help. (this is the first time i've ever posted anything on a website. my wife and I are technophobes.)
Hello everyone... I need "No-Block PopUp Window" for my web site.. for example if users open my sites another sites show or opens for them.. even a full page site like full pages ads.. and it be like One time per hour or more.. I found some script like that but some of them being blocked by IE or other browsers.. if anyone has kinda this JS code.. Please share it.. Thanks a lot What is the code to stop people from viewing your source. Such as this site: http://bad-behavior.com (View The Source of That Site) I've searched the forums, and all I got was a bunch of "nothing can protect your source" I don't care about all of that. I want the code because: 1. Most people don't know how to view a source after it has been blocked 2. I think it's cool ok i need a bit of advice.. I have a webpage and i want to put a section of another website on to my own website.. The Section i want to put on my website is on this page www.bebo.com/thegaadiscos and i only want to put the section with the comments on it... What i want is a bit like the face book section of this website http://www.alexandraburkeofficial.com/ How would this be done does anyone know.. Hi All, Below is a block of data. I'm trying to figure out how to extract text from the block. As you will see, some lines will have answers, some will not. I thought about using split, however not every line has the same delimiters (eg. $), and I am unsure how to apply 2 different splits per line, the only constant is that every line has a line feed at the end. E.g: YourPersonTitle$Title : Mr In the example above, I need to pull out everything between $ and line feed, so the result is: Title : Mr basically, any line with an answer needs to be returned. There would be a maximum of about 100 lines. I am currently reading a primer on regular expressions, but would appreciate some help or a point in the right direction. Code: YourPersonTitle$Title : Mr YourPersonTitle$OtherTitle : YourPersonalDetails$Surname : Citizen YourPersonalDetails$FirstName : Joe YourPersonalDetails$OtherNames : YourPersonalDetailsDOB : 1.11.1900 YourPostalAddress$Address : 2 Road Street, Sydney YourPostalAddress$State : NSW YourPostalAddress$Postcode : 2200 YourPhoneEmail$HomePhone : 9999 7777 Hey. I'm working on a simple slideshow made with jQuery, and i need some help now. What i'm trying to do now, is to make it change image every X second. I know how to change image, but i'm kind of stuck trying to find out how to make it "do something" every Xth second... i hope you understand what i mean. Here's an example: (obviously not working..) Code: function slideSwitch() { //change image... } setInterval(slideSwitch, 5000); //make the function slideSwitch execute every 5th second. If anyone could help me out here, i'd really appreciate it! Also, is there any "else if" function in jQuery? Like in for example PHP, you can use "if", "else if" and "else".. like this: Code: if(){ }else if(){ }else { } So is there any function like that? I googled it, and i found out i have to use some kind of plugin for it to work? How do i use it? Thanks in advance, -Nike Hey. I'm kind stuck here. I can't see what's wrong with this small set of code? Is there anything wrong? I'm trying to follow a tutorial at themeforest.net, but i'm getting both confused and frustrated as it doesn't do anything at all! Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script src="jquery-1.4.1.min.js" type="text/javascript"></script> <style type="text/css"> #box { height: 300px; width: 300px; background: #2367AB; } </style> <script type="text/javascript"> $(document).ready(function() { $('a').click(function() { $('box').fadeOut(1000); }); }); </script> </head> <body> <div id="box"></div> <a href="#">Click me!</a> </body> </html> Basically i have made a small gallery with a lightbox feature, and it half works. What i am trying to do is make the lightbox fade out the flash navigation like the rest of the page but it just seems to overlap my lightbox. Any ideas? Here is the link for the webpage: http://www.frozen-shy.webs.com/arts_signatures.html Here is the javascript code: Code: /* Table of Contents ----------------- Configuration Functions - getPageScroll() - getPageSize() - pause() - getKey() - listenKey() - showLightbox() - hideLightbox() - initLightbox() - addLoadEvent() Function Calls - addLoadEvent(initLightbox) */ // // Configuration // // If you would like to use a custom loading image or close button reference them in the next two lines. var loadingImage = 'loading.gif'; var closeButton = 'close.gif'; // // getPageScroll() // Returns array with x,y page scroll values. // Core code from - quirksmode.org // function getPageScroll(){ var yScroll; if (self.pageYOffset) { yScroll = self.pageYOffset; } else if (document.documentElement && document.documentElement.scrollTop){ // Explorer 6 Strict yScroll = document.documentElement.scrollTop; } else if (document.body) {// all other Explorers yScroll = document.body.scrollTop; } arrayPageScroll = new Array('',yScroll) return arrayPageScroll; } // // getPageSize() // Returns array with page width, height and window width, height // function getPageSize(){ var xScroll, yScroll; if (window.innerHeight && window.scrollMaxY) { xScroll = document.body.scrollWidth; yScroll = window.innerHeight + window.scrollMaxY; } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac xScroll = document.body.scrollWidth; yScroll = document.body.scrollHeight; } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari xScroll = document.body.offsetWidth; yScroll = document.body.offsetHeight; } var windowWidth, windowHeight; if (self.innerHeight) { // all except Explorer windowWidth = self.innerWidth; windowHeight = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode windowWidth = document.documentElement.clientWidth; windowHeight = document.documentElement.clientHeight; } else if (document.body) { // other Explorers windowWidth = document.body.clientWidth; windowHeight = document.body.clientHeight; } // for small pages with total height less then height of the viewport if(yScroll < windowHeight){ pageHeight = windowHeight; } else { pageHeight = yScroll; } // for small pages with total width less then width of the viewport if(xScroll < windowWidth){ pageWidth = windowWidth; } else { pageWidth = xScroll; } arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) return arrayPageSize; } // // pause(numberMillis) // Pauses code execution for specified time. Uses busy code, not good. // Code from http://www.faqts.com/knowledge_base/view.phtml/aid/1602 // function pause(numberMillis) { var now = new Date(); var exitTime = now.getTime() + numberMillis; while (true) { now = new Date(); if (now.getTime() > exitTime) return; } } // // getKey(key) // Gets keycode. If 'x' is pressed then it hides the lightbox. // function getKey(e){ if (e == null) { // ie keycode = event.keyCode; } else { // mozilla keycode = e.which; } key = String.fromCharCode(keycode).toLowerCase(); if(key == 'x'){ hideLightbox(); } } // // listenKey() // function listenKey () { document.onkeypress = getKey; } // // showLightbox() // Preloads images. Places new image in lightbox then centers and displays. // function showLightbox(objLink) { // prep objects var objOverlay = document.getElementById('overlay'); var objLightbox = document.getElementById('lightbox'); var objCaption = document.getElementById('lightboxCaption'); var objImage = document.getElementById('lightboxImage'); var objLoadingImage = document.getElementById('loadingImage'); var objLightboxDetails = document.getElementById('lightboxDetails'); var arrayPageSize = getPageSize(); var arrayPageScroll = getPageScroll(); // center loadingImage if it exists if (objLoadingImage) { objLoadingImage.style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - 35 - objLoadingImage.height) / 2) + 'px'); objLoadingImage.style.left = (((arrayPageSize[0] - 20 - objLoadingImage.width) / 2) + 'px'); objLoadingImage.style.display = 'block'; } // set height of Overlay to take up whole page and show objOverlay.style.height = (arrayPageSize[1] + 'px'); objOverlay.style.display = 'block'; // preload image imgPreload = new Image(); imgPreload.onload=function(){ objImage.src = objLink.href; // center lightbox and make sure that the top and left values are not negative // and the image placed outside the viewport var lightboxTop = arrayPageScroll[1] + ((arrayPageSize[3] - 35 - imgPreload.height) / 2); var lightboxLeft = ((arrayPageSize[0] - 20 - imgPreload.width) / 2); objLightbox.style.top = (lightboxTop < 0) ? "0px" : lightboxTop + "px"; objLightbox.style.left = (lightboxLeft < 0) ? "0px" : lightboxLeft + "px"; objLightboxDetails.style.width = imgPreload.width + 'px'; if(objLink.getAttribute('title')){ objCaption.style.display = 'block'; //objCaption.style.width = imgPreload.width + 'px'; objCaption.innerHTML = objLink.getAttribute('title'); } else { objCaption.style.display = 'none'; } // A small pause between the image loading and displaying is required with IE, // this prevents the previous image displaying for a short burst causing flicker. if (navigator.appVersion.indexOf("MSIE")!=-1){ pause(250); } if (objLoadingImage) { objLoadingImage.style.display = 'none'; } objLightbox.style.display = 'block'; // After image is loaded, update the overlay height as the new image might have // increased the overall page height. arrayPageSize = getPageSize(); objOverlay.style.height = (arrayPageSize[1] + 'px'); // Check for 'x' keypress listenKey(); return false; } imgPreload.src = objLink.href; } // // hideLightbox() // function hideLightbox() { // get objects objOverlay = document.getElementById('overlay'); objLightbox = document.getElementById('lightbox'); // hide lightbox and overlay objOverlay.style.display = 'none'; objLightbox.style.display = 'none'; // disable keypress listener document.onkeypress = ''; } // // initLightbox() // Function runs on window load, going through link tags looking for rel="lightbox". // These links receive onclick events that enable the lightbox display for their targets. // The function also inserts html markup at the top of the page which will be used as a // container for the overlay pattern and the inline image. // function initLightbox() { if (!document.getElementsByTagName){ return; } var anchors = document.getElementsByTagName("a"); // loop through all anchor tags for (var i=0; i<anchors.length; i++){ var anchor = anchors[i]; if (anchor.getAttribute("href") && (anchor.getAttribute("rel") == "lightbox")){ anchor.onclick = function () {showLightbox(this); return false;} } } // the rest of this code inserts html at the top of the page that looks like this: // // <div id="overlay"> // <a href="#" onclick="hideLightbox(); return false;"><img id="loadingImage"></a> // </div> // <div id="lightbox"> // <a href="#" onclick="hideLightbox(); return false;" title="Click anywhere to close image"> // <img id="closeButton"> // <img id="lightboxImage"> // </a> // <div id="lightboxDetails"> // </div> // </div> var objBody = document.getElementsByTagName("body").item(0); // create overlay div and hardcode some functional styles (aesthetic styles are in CSS file) var objOverlay = document.createElement("div"); objOverlay.setAttribute('id','overlay'); objOverlay.onclick = function () {hideLightbox(); return false;} objOverlay.style.display = 'none'; objOverlay.style.position = 'absolute'; objOverlay.style.top = '0'; objOverlay.style.left = '0'; objOverlay.style.zIndex = '90'; objOverlay.style.width = '100%'; objBody.insertBefore(objOverlay, objBody.firstChild); var arrayPageSize = getPageSize(); var arrayPageScroll = getPageScroll(); // preload and create loader image var imgPreloader = new Image(); // if loader image found, create link to hide lightbox and create loadingimage imgPreloader.onload=function(){ var objLoadingImageLink = document.createElement("a"); objLoadingImageLink.setAttribute('href','#'); objLoadingImageLink.onclick = function () {hideLightbox(); return false;} objOverlay.appendChild(objLoadingImageLink); var objLoadingImage = document.createElement("img"); objLoadingImage.src = loadingImage; objLoadingImage.setAttribute('id','loadingImage'); objLoadingImage.style.position = 'absolute'; objLoadingImage.style.zIndex = '150'; objLoadingImageLink.appendChild(objLoadingImage); imgPreloader.onload=function(){}; // clear onLoad, as IE will flip out w/animated gifs return false; } imgPreloader.src = loadingImage; // create lightbox div, same note about styles as above var objLightbox = document.createElement("div"); objLightbox.setAttribute('id','lightbox'); objLightbox.style.display = 'none'; objLightbox.style.position = 'absolute'; objLightbox.style.zIndex = '100'; objBody.insertBefore(objLightbox, objOverlay.nextSibling); // create link var objLink = document.createElement("a"); objLink.setAttribute('href','#'); objLink.setAttribute('title','Click to close'); objLink.onclick = function () {hideLightbox(); return false;} objLightbox.appendChild(objLink); // preload and create close button image var imgPreloadCloseButton = new Image(); // if close button image found, imgPreloadCloseButton.onload=function(){ var objCloseButton = document.createElement("img"); objCloseButton.src = closeButton; objCloseButton.setAttribute('id','closeButton'); objCloseButton.style.position = 'absolute'; objCloseButton.style.zIndex = '200'; objLink.appendChild(objCloseButton); return false; } imgPreloadCloseButton.src = closeButton; // create image var objImage = document.createElement("img"); objImage.setAttribute('id','lightboxImage'); objLink.appendChild(objImage); // create details div, a container for the caption and keyboard message var objLightboxDetails = document.createElement("div"); objLightboxDetails.setAttribute('id','lightboxDetails'); objLightbox.appendChild(objLightboxDetails); // create caption var objCaption = document.createElement("div"); objCaption.setAttribute('id','lightboxCaption'); objCaption.style.display = 'none'; objLightboxDetails.appendChild(objCaption); } // // addLoadEvent() // Adds event to window.onload without overwriting currently assigned onload functions. // function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function'){ window.onload = func; } else { window.onload = function(){ oldonload(); func(); } } } addLoadEvent(initLightbox); // run initLightbox onLoad Any help is much appreciated xx Hi I am generating a report on submit click.Due to size of data query execution takes some time to display result, in mean time if user press reload button on browser toolbar consequently same query request going to database and the performance become slow down. I am able to restrict user from clicking F5 and ctrl+R button but not reload button. I there any way to handle event on reload button? or can we disable reload button on submit? Thanks in advance! So never done this one before so I am having a bit of a time trying to figure this one out. Say I have a list of LI element and only a few of them have a inline style of display block, the rest have a display of none. How would I go about looping through and dertmining the number of elements that have a display of block? Code: for(var m = 0; m < li.style.display.length; i++) { alert(m); }; The above is just crazy but where my mind melts.. I want a Login Box to be opened in modal window when user clicks on a link and authentication is done with Ajax. I tried jQuery BlockUI, jQuery UI, ThickBox. But they are large in scope. I also tried writing separate plugin for my need but i don't have clear idea how does it work. So please either suggest a way or give me link to article which is simple to understand and can clear how it work. Hi all, I've got some simple code that I use to drag the corners of a DIV to resize it on the fly. One thing that bothers me is that there is a "global" variable just hanging outside and I would rather "encapsulate" it all into a block of code so that the variable persists, but is not visible outside of the code that uses it. So, here's the code: Code: /*** * support for mouse drag resize of mChat window * "global" save of mouse start position **/ var start = 0; /*** * do-nothing function to attach unused events to **/ function nullFunc () { return false; }; /*** * begin drag **/ function drag () { start = 0; document.onmouseup = up; document.onmousedown = nullFunc; document.onmousemove = move; return false; }; /*** * end drag **/ function up () { start = 0; document.onmouseup = nullFunc; document.onmousedown = nullFunc; document.onmousemove = nullFunc; return false; }; /*** * mouse move capture **/ function move (e) { var o = mouseXY(e); /* mouseXY not shown here */ if (start) { mChatSize(o.y - start); /* mChatSize not shown here */ } start = o.y; return false; }; You see the code captures the mouse Y coordinate and then subtracts "start" from it to generate a DELTA (which is what the mChatSize function needs). So, moving the mouse up generates "-1, -1, -1" maybe -2 if dragged fast and +1 +1 +1... if moved down.... you see? Now what I want to do is put all this code in a "box" so that "start" is global to the box, but invisible outside. I tried to do it and made no headway... I'm sure it's simple and I'm just missing it. Any help will be appreciated. Thanks! -- Roger I'm building a new website and I need to know where I can get a decent search engine script, a small commenting section and an easy to do login system. Thanks I have a website and I am looking at putting a few quality games on it. I was thinking an online poker game, rpg, and a few others... I want a gooed mix of games put again I am not a gaming website. The main feature that I am trying to get is that when a customer of the site plays the games I would like them to earn credits. The customer at the end of the month with the most credits will receive a cash prize. Also maybe we could have a leaderboard or something too so that other customers can see that it is actually legit. If you have any resources thath you can think of or you know of something fairly close to what I am talking about please let me know.
Hello. I finished building my website yesterday, but apparently it has a trojan on it. I don't understand how this could happen because I also have the website on godaddy and when I viewed that link- there was never a trojan. Right now were hosting the server on www.doteasy.com I do have an idea though, I think it might be because of a javascript I have on there in the index page - because I put it on so I could have a picture slideshow. Here are the two links to the site, if anyone would like to shed some light on this for me. Thanks. Here are the two websites: (both the same but different hosting companies) The one from doteasy.com has the trojan.... Doteasy.com: http://www.wmorinjr.com/Baba/index.html Godaddy.com: http://www.webdesignsbyapw.com/wayne/index.html I'm new to wordpress, I've just made a website and I want to make small modification: I want to remove the buttons in red. I thought it was CSS. But I've discovered that JS can't be overwritten by CSS so here I am. In firebug, I can see this: element.style { display: block; } When I change it to "display: none" buttons do disappear but I don't know in which file to find this sentence. A JS file is attached as txt. Can anybody give me a hand? This is the site: http://franciscourrea.com/sitio/ buttons by panchoskywalker, on Flickr |