JavaScript - Protect Content
I work for a certain print and online publication. The one problem we have is other sites copying ad pasting our content to thier own websites or blogs. Wondering if theirs some way to allow a user to only to be able to copy/paste a certain character limit and then somehow add link to copied and pasted blurb?
Maybe theirs a way to use javascript to command notepad to only allow a set number of characters.... Maybe theirs a service available or should be. Similar TutorialsI know it is impossible to protect js. Minify and obfuscation don't seem very effective. But I ran across code like this, which could not be unobfuscated via simple methods. It appears to have non ascii characters (which I didn't know was possible). I would like to know how to create this same effect to help improve my protection. I realize it will not be highly secure, but something should be better than nothing. A portion of the .js: `XEnE)J:2\x00dzA\ EDIT: That doesn't work since the forum can only interpret ascii. But in the actual .js there are non ascii characters. What was done to achieve this? hello, I have designed a web site. but I want to protect my external javascript(and css also) from outside people, who steal my javascript. can anyone tell me a method to hide external javascript(and css) from these knaves...!!! thank you Can someone please suggest a good (and simple) code for password protecting one page on a site? I have a plan room for blueprints on my site. There will be multiple jobs at a given time and I need a page where we can give out a password to get the plans. Once the person logs in with user name and password for that day, he would then see file folders with the name of each job next to it. When he chooses a job, he clicks the folder to display a list of plans. If you can help with this or point me in a good direction, it would be greatly appreciated. Thanks for your help! Hey everybody. I have this code that disables right clicking on a page. It works fine, but I'd like to tweak it a little bit if possible. When trying to right click on a page, the script will pop up an alert message. If you try right clicking a second time, you receive an option to disable the alert message. I want to disable this option so that the alert pops up every single time, but I have no idea how to actually do this. Can anybody help me out? Thanks. Code: <script type="text/javascript" language="javascript"> var message="ALERT MESSAGE"; function click(e) { if (document.all) { if (event.button==1||event.button==2) { alert(message); return false; } } else { if (e.button==1||e.button==2) { e.preventDefault(); e.stopPropagation(); alert(message); return false; } } } if (document.all){ document.onmousedown=click; } else{ document.onclick=click; } </script> Hi all, I am using xmlhttp.open();xmlhttp.send(); to send a php content to a div. This php content is again using the same method to get php content from a further page. The content of the div, does not seem to be using the css and javascript files defined in the calling pages <head> section. Does anyone know why this is? Is there a workaround or solution to this problem? It might be easier to understand looking at the code, so Background info: Javascript file: scripts.js client.php ----> loads data from: display_client.php display_client.php ----> loads data from: display_brand.php Code: client.php http://pastebin.com/4EFn9YRf display_client.php http://pastebin.com/BGZAKre2 display_brand.php http://pastebin.com/0a4Pg3gg scripts.js http://pastebin.com/er4dkmPc Thanks! Ok, I would post my entire data here but then yall would be reading insane amounts of script. I've got a div content jquery slider on my site I am making and it works beautifully in all browsers(took me a while). Then, I decided why not have it where when people click on a "read more" link that it pops up a box, instead of directing to the new page, and displays the contents of a div. It would not work at all. My question is there a possible way to do this?
Hi, Well this plugin stops working after completely loading the flash content or game. I did a few changes to it but still, it won't show the game after completely loading the flash. Can someone tell me what's wrong? Here is the link to live working example http://files.cryoffalcon.com/Piecema...s/testing.html I am creating a testimonials page on a customers site, and I am wanting it to be like a scrolling content. I have the border created, and I want to have text inside the border that will scroll sideways displaying a new one every 10 seconds or so, but having the ability to move between the content. Can anyone tell me what sort of script I should use? I've seen something like it before, but I've had a mind blank. I know it's some kind of Java scripting. Any ideas? Thanks in advance I realy did not mean over image I ment some like "text"<br> then image here there are 4 parts to this script. I am trying to change it so that there is text content over the image. part 1 Code: meta http-equiv="imagetoolbar" content="false" /> <link rel="stylesheet" href='slideshow1.css' type="text/css" /> <script type="text/javascript" src="xfade2.js"></script> <div id="rotator"> AD One<a href="$siteurl/index.pl" onmouseover=\"Tip('<img src="/upload/3282.jpg" width="300">')\" onmouseout=\"UnTip()\"><img src="imageone.jpg" width="120" height="90" border="0" alt="2 bed/1 bath House" /></a> Ad TWO1<a href="$siteurl/index.pl" onmouseover=\"Tip('<img src="/upload/2485.jpg" width="300">')\" onmouseout=\"UnTip()\"><img src="imagetwo.jpg" width="120" height="90" border="0" alt="CSS Beauty" /></a> </div> the "AD ONE" and "AD two" Content above is what I would like to show up over the image and roate with it. I think I just need to change something in part 4 of the code but not sure were. part two slideshow1.css Code: * { margin: 0; padding: 0; } #rotator { border: 1px solid #000; cursor: pointer; overflow: hidden; margin: 50px auto 10px; position: relative; width: 120px; height: 90px; } #rotator img { border: 0; cursor: pointer; width: 120px; height: 90px; } p { text-align: center; } part 3 slideshow2.css Code: #rotator img { display: none; position: absolute; top: 0; left: 0; } part 4 xfade2.js Code: /* Image Cross Fade Redux Version 1.0 Last revision: 02.15.2006 steve@slayeroffice.com Rewrite of old code found he http://slayeroffice.com/code/imageCrossFade/index.html */ window.addEventListener?window.addEventListener('load',so_init,false):window.attachEvent('onload',so_init); var d=document, imgs = new Array(), zInterval = null, current=0, pause=false; function so_init() { if(!d.getElementById || !d.createElement)return; css = d.createElement('link'); css.setAttribute('href','slideshow2.css'); css.setAttribute('rel','stylesheet'); css.setAttribute('type','text/css'); d.getElementsByTagName('head')[0].appendChild(css); imgs = d.getElementById('rotator').getElementsByTagName('img'); for(i=1;i<imgs.length;i++) imgs[i].xOpacity = 0; imgs[0].style.display = 'block'; imgs[0].xOpacity = .99; setTimeout(so_xfade,3000); } function so_xfade() { cOpacity = imgs[current].xOpacity; nIndex = imgs[current+1]?current+1:0; nOpacity = imgs[nIndex].xOpacity; cOpacity-=.05; nOpacity+=.05; imgs[nIndex].style.display = 'block'; imgs[current].xOpacity = cOpacity; imgs[nIndex].xOpacity = nOpacity; setOpacity(imgs[current]); setOpacity(imgs[nIndex]); if(cOpacity<=0) { imgs[current].style.display = 'none'; current = nIndex; setTimeout(so_xfade,3000); } else { setTimeout(so_xfade,50); } function setOpacity(obj) { if(obj.xOpacity>.99) { obj.xOpacity = .99; return; } obj.style.opacity = obj.xOpacity; obj.style.MozOpacity = obj.xOpacity; obj.style.filter = 'alpha(opacity=' + (obj.xOpacity*100) + ')'; } } Dear All, please i want to create content image rotator with thumbs image horizontal and starts automatically.you can understand more when you see http://maktoob.yahoo.com/?p=us many thanks for your efforts What wrong in this code? Code: <script type="text/javascript" src="jquery.js"></script> <script> $(function (){ function manda(){ var text = $('#frame').contents().find('p[class=no_boder]').html(); $('div').html(text); } }); </script> i've already tried using this -> $('#frame').contents().html(); How can i get the content? Hi For example I have a HTML table... Code: name | grade | action bob | 1.0 | [button class="button" id='1'] jack | 2.0 | [button class="button" id='2'] john | 3.0 | [button class="button" id='3'] When I click the button, to get the id... Code: $(function(){ $('.button').click(function() var buttonid = this.id }); }); so if I were to press buttonid 1 how do I get the grade '1.0' without having to open the database? I have two effects, one is a fadein effect and one is a smooth scrolling effect. I also have a simple image slider but that isn't the problem. It doesn't seem like the fadein is the problem either because when I had non-scrolling (positioned absolute) content "fadein", it wouldn't fadein in IE but at least it showed up, whereas the main content is blocked in IE with a dialogue about not running scripts or activex. Is there a way to overwrite this? I tried running the basic example of smooth scrolling in IE9 and it worked fine without being blocked. My code seems the same! I would be ok with the content just not fading in when using IE9, but if a user doesn't know to enable activex scripts from the dialogue box (assuming they even get a dialogue box), they won't be able to read any of the content which is an issue. Here's the JavaScript in the head section: Code: <script type="text/javascript" src="jquery.js"></script> <script> function goToByScroll(id){ $('html,body').animate({scrollTop: $("#"+id).offset().top},'slow');} </script> <link href="template.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="slider.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#slider").easySlider({ auto: true, continuous: true }); }); </script> <link href="slider2.css" rel="stylesheet" type="text/css" media="screen" /> <script> function fadein(){var fade=0,fadein=document.getElementById("fadein").style,ms=(fadein.opacity==0)?0:1,pace=setInterval(Fade,40);function Fade(){if(fade<100){fade+=2;if(ms)fadein.filter="alpha(opacity="+fade+")";else fadein.opacity=(fade/100)}else clearInterval(pace)}}; window.onload=fadein; </script> </head> Hi guys, I am working with a plugin calld Hashslider which is a fairly simple div slider. Here is the code for startrs Code: // hashslider v0.9 by manuel huegel, copyright 2010 // mgoys.com $(document).ready(function(){ //get width and height of the wrapper and give it to the UL var wrapperwidth = $('#slider').width() * $('#slider ul > li').size(); $('#slider ul').css('width', wrapperwidth); var wrapperheight = $('#slider').height(); $('#slider ul').css('height', wrapperheight); //set my li width var width = $('#slider').width(); $('#slider ul li').css('width', width); //set my counter vars var counter = $('#slider ul > li').size(); var decount = 1; var autocount = 1; //create my number navigation var createNum = 1; $('#numbers li:first-child').html(createNum).addClass('activenum').attr('id', 'id1'); while ( createNum != counter) { $('#numbers li:last-child').after('<li> </li>'); createNum++; $('#numbers li:last-child').html(createNum); $('#numbers li:last-child').attr('id', 'id' + createNum); } //get my number-width (number navigation should always be centered) var numwidth = $('#numbers li:first-child').width() * $('#numbers li').size(); $('#numbers').css('width', numwidth); //slide the button to the next item function goNext() { if ( decount != counter) { $('#slider ul').animate({ left: '-=' + $('#slider').width() }, 400, 'swing', function() { }); $('.activenum').removeClass('activenum').next().addClass('activenum'); decount++; window.location.hash = decount; } } function goBack() { if ( decount != 1) { $('#slider ul').animate({ left: '+=' + $('#slider').width() }, 400, 'swing', function() { }); $('.activenum').removeClass('activenum').prev().addClass('activenum'); decount--; window.location.hash = decount; } } //make the number clickable $("#numbers li").click(function() { //$('#info4').html( $(this).html() ); var clickednum = $(this).html() * - $('#slider').width() + $('#slider').width(); //$('#info4').html( clickednum ); $('#slider ul').animate({ left: clickednum }, 400, 'swing', function() { }); $('.activenum').removeClass('activenum'); $(this).addClass('activenum'); decount = $(this).html(); window.location.hash = $(this).html(); }); //thaths the hash-shizzle if ( window.location.hash != '') { //get hash, scroll to position var hashnum = window.location.hash.substr(1) * - $('#slider').width() + $('#slider').width(); $('#slider ul').animate({ left: hashnum }, 0, function() { }); //set counters to position decount = window.location.hash.substr(1); $('.activenum').removeClass('activenum'); var hashname = window.location.hash.substr(1); $('#id' + hashname).addClass('activenum'); } //get my clickers $("#right").click(function() { goNext(); }); $("#left").click(function() { goBack(); }); //get mousewheel function $("#slider ul").mousewheel(function(event, delta) { if (delta > 0) { goBack(); event.stopPropagation();event.preventDefault(); } }); $("#slider ul").mousewheel(function(event, delta) { if (delta < 0) { goNext(); event.stopPropagation();event.preventDefault(); } }); }); As you will see the current code loops through all of the slides, and when it reaches the last (or first) the previous and next links become unclickable. I would like to go a stage further than this and make them dissapear entirely. I don't know how to do this or even to start, I dont even know what function to edit. Please help guys. Thanks in advance Dan I want to create several pages (they can be text or html) with basic informatons for css formatting. example: <div class="appname" name: this app <div class="appdetails"> Version: 1.0 Date: 1/1/2011 Description: this is an app </div> </div> I want to be able to save several of these and load them into a web page where they are formatted and displayed. This needs to be a client side solution so that I can be able to access this offline. Any suggestions? Edit: so far I have tried this but I am not sure about it. <object type="text/html" data="app1.html"> Hi, I wish to get the content inside a td-tag and use with JS operators. This is my source. Code: <style> #a { display : none; } </style> <table> <tr id="field_id-6"> <td valign="top" width="50%" style="text-align:right;"> <span style="color:#333333;">Number</span>: </td> <td valign="top" width="50%" style="text-align:left; overflow:hidden;"> <div class="field_uneditable">120</div> </td> </tr> </table> <img src="../image.png" id="a"> <script> var x= ; if(x>49) { document.getElementById("a").style.display = "block"; } </script> So I need to indicate x as the number 120. But I can't just write 120 beside x, because 120 will change to a new number. Hello. Is it possible to use java script to direct users to different page depending on their username login and password? And if so, what is the script? The website i am creating is for a conference my school is hosting. What I want to do is give the username and password for each delegation to use; once they log in, they will be directed to a page which contains information pertaining only to their delegation. Right now, this is the script I have, but it only directs to one page, which is "user1.php". I want to be able to direct user2 to user2.php, user3 to user3.php and so on. <?php $usernames = array("user1", "user2", "user3", "superman"); $passwords = array("pass1", "pass2", "password3", "supermans password"); $page = "user1.php" for($i=0;$i<count($usernames);$i++){ $logindata[$usernames[$i]]=$passwords[$i]; } if($logindata[$_POST["username"]]==$_POST["password"]){ session_start(); $_SESSION["username"]=$_POST["username"]; header('Location: '.$page); exit; }else{ header('Location: login.php?wrong=1'); exit; } ?> Any help would be greatly appreciated. Thanks! I am using a Theme Tester on my site so normal users can not see the changes being made. If you can help me, please send me a PM & I will give you a temporary login so you can login & see the new site, and the issue I am having. Basically, I am trying to get this http://flowplayer.org/tools/demos/sc.../navigator.htm scroller to work, but it is not happening at all. Not sure what is going on. Please advise. Thanks! Hello, I have been using interstitial boxes for quite a while and have never had a problem. I was required to create an interstitial box this week. When the home page is display in Firefox and Safari, the interstitial box displays right away as it is supposed to do; however, it will not display in Internet Explorer 7 unless you refresh the screen. Is this a known problem? Is there a way of correcting this? [URL] http://jpl.coj.net [URL] Thank you for your help, Elbee |