Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 10-19-2018, 05:23 AM   #1
lezinterracial
Confirmed User
 
Industry Role:
Join Date: Jul 2012
Posts: 2,920
javascript question, textbox space and carriage return added

javascript question, space and carriage return added to the output text.

I am working on a chrome extension that encodes text. But a space and carriage return are being added to the output. Anybody know why?

example
http://nicecamgirls.com/popup.htm
lezinterracial is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-19-2018, 05:23 AM   #2
lezinterracial
Confirmed User
 
Industry Role:
Join Date: Jul 2012
Posts: 2,920
my code
Code:
<body>
<script>

function encodeFunction() {
 var x;
 x = document.getElementById("inputtext").value;	
 if(document.getElementById('urlEncodecheck').checked){   
    var encodex;
    encodex = encodeURIComponent(x);
 }
 if(document.getElementById('HTMLEncodecheck').checked){   
    var encodex;
    encodex =  x.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
 }                                                          
 if(document.getElementById('hexencodecheck').checked){
    var s = unescape(encodeURIComponent(x))
    var encodex = ''
    for (var i = 0; i < s.length; i++) {
        encodex += "%" + s.charCodeAt(i).toString(16)
    }}
 if(document.getElementById('base64Encodecheck').checked){
    var encodex = '';
    encodex = window.btoa(x);
   }

  document.getElementById("outputttext").value = encodex;
 }
</script>

<h1>Encode</h1>

<form action="">
  <input type="radio" name="encodetype" id="urlEncodecheck" checked="checked" oninput="encodeFunction()">Url<br>
  <input type="radio" name="encodetype" id="base64Encodecheck" oninput="encodeFunction()">Base64<br>
  <input type="radio" name="encodetype" id="HTMLEncodecheck" oninput="encodeFunction()">HTML<br>
  <input type="radio" name="encodetype" id="hexencodecheck" oninput="encodeFunction()">Hex
<h2>Input</h2>
<textarea id="inputtext" rows="4" cols="50" oninput="encodeFunction()" autofocus>
 
</textarea>
<h2>Output</h2>
<textarea id="outputttext" rows="4" cols="50" readonly>
</textarea>
</body>
lezinterracial is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-19-2018, 07:35 AM   #3
sarettah
l8r
 
Industry Role:
Join Date: Oct 2002
Posts: 13,488
The extra shit is coming from your textarea. The way you coded the textarea puts spaces and the line feed in there. Just put the textarea close right up against the open and the extra shit should go away.


<textarea id="inputtext" rows="4" cols="50" oninput="encodeFunction()" autofocus></textarea>


.
sarettah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-19-2018, 07:41 AM   #4
CurrentlySober
Too lazy to wipe my ass
 
CurrentlySober's Avatar
 
Industry Role:
Join Date: Aug 2002
Location: A Public Bathroom
Posts: 37,851
i%20like%20poo%20%0A

aSBsaWtlIHBvbyAK

i like poo

%69%20%6c%69%6b%65%20%70%6f%6f%20%a
__________________


👁️ 👍️ 💩
CurrentlySober is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-19-2018, 08:26 AM   #5
sarettah
l8r
 
Industry Role:
Join Date: Oct 2002
Posts: 13,488
Quote:
Originally Posted by sarettah View Post
The extra shit is coming from your textarea. The way you coded the textarea puts spaces and the line feed in there. Just put the textarea close right up against the open and the extra shit should go away.


<textarea id="inputtext" rows="4" cols="50" oninput="encodeFunction()" autofocus></textarea>

BTW, if any one cares. "extra shit" is the technical term for that extra shit

.
sarettah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-19-2018, 08:41 AM   #6
lezinterracial
Confirmed User
 
Industry Role:
Join Date: Jul 2012
Posts: 2,920

Quote:
Originally Posted by sarettah View Post
The extra shit is coming from your textarea. The way you coded the textarea puts spaces and the line feed in there. Just put the textarea close right up against the open and the extra shit should go away.


<textarea id="inputtext" rows="4" cols="50" oninput="encodeFunction()" autofocus></textarea>


.
You are awesome sarettah. I really should have seen that.
lezinterracial is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-19-2018, 08:48 PM   #7
sarettah
l8r
 
Industry Role:
Join Date: Oct 2002
Posts: 13,488
Quote:
Originally Posted by lezinterracial View Post
You are awesome sarettah. I really should have seen that.
One of those dumb mistakes that we all make.

I spent a couple of hours the other day tracking down an issue. Turned out to be an errant semi colon.

File it under things that make me go: "Duh".

;p

.
sarettah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks

Tags
return, added, carriage, space, text, javascript, output, question, textbox, chrome, extension, encodes



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.