Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > Web Development
You last visited: Today at 03:40

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



JavaScript escaped automatisch?

Discussion on JavaScript escaped automatisch? within the Web Development forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 300
Join Date: Apr 2013
Posts: 3,234
Received Thanks: 1,205
JavaScript escaped automatisch?

Hallo, iwie escaped JS bei mir einen String automatisch, obwohl der gar nicht escaped werden muss.

Der Code:

Code:
var variables = '{"id":"' + 123 + '","first":12,"after":"' + "sadasd213123" + '"}';
print(variables);
Die Ausgabe davon:

"{\"id\":\"123\",\"first\":12,\"after\":\"sadasd21 3123\"}"

Die Ausgabe die ich will:

{"id":"123","first":12,"after":"sadasd213123"}


Wenn ich das teste funktioniert es..

Warum passiert das?
#Saiirex is offline  
Old 03/29/2018, 12:32   #2
dotCom
 
Devsome's Avatar
 
elite*gold: 9842
The Black Market: 107/0/0
Join Date: Mar 2009
Posts: 16,845
Received Thanks: 4,675
Code:
jsonString = '{"id":"' + 123 + '","first":12,"after":"' + "sadasd213123" + '"}';
print( JSON.stringify(JSON.parse(jsonString),null,2) );
Devsome is offline  
Old 03/29/2018, 12:35   #3
 
elite*gold: 300
Join Date: Apr 2013
Posts: 3,234
Received Thanks: 1,205
Quote:
Originally Posted by Devsome View Post
Code:
jsonString = '{"id":"' + 123 + '","first":12,"after":"' + "sadasd213123" + '"}';
print( JSON.stringify(JSON.parse(jsonString),null,2) );
Wird in der Console von Firefox trzd. escaped.

Okay, seltens sowas blödes gehabt...

Der FF escaped nur in der Ausgabe, ich hatte einen Breakpoint vor einer Asynchronen Methode und der ist da nie rein gegangen, weshalb ich dachte dass der Link wirklich escaped ist. Breakpoint richtig gesetzt und alles läuft
#Saiirex is offline  
Reply


Similar Threads Similar Threads
[VB.net] "escaped unicode" String dekodieren [bsp. "Dave\u0099"]
12/12/2013 - .NET Languages - 4 Replies
Hey, ich habe ein Problem beim dekodieren von einem "escaped unicode" String. Warum in "" gesetzt? weil ich mir nicht sicher bin, ob der String auch wirklich "escaped unicode" heißt. Als Beispiel könnt ihr "Dave\u0099" nehmen, wo Dave™ herauskommen muss. Ein kleiner Ansatz würde mir schon weiterhelfen :) LG, Dave
Suche einen simplen Javascript was ein Bild automatisch bewegen lässt
06/13/2012 - Web Development - 6 Replies
Suche einen simplen Java script Ein Bild sollte sich automatisch von Links nach rechts,von rechts nach unten danach wieder links und wieder hoch bewegen^^ wenns geht bitte in Schlangen form aber muss nicht sein danke.. (Schlangenform so : ___________________ __________________| |__________________
Im here, i escaped!
11/16/2008 - Say Hello - 2 Replies
Hi, i am new here, i am most interested in SF...and Gunz... and most of all i need Aimpoint, i cant quickscope to save my life xD and....stuff...so....neway... HI!



All times are GMT +1. The time now is 03:40.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.