-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWebForm1.aspx
More file actions
59 lines (51 loc) · 2.12 KB
/
WebForm1.aspx
File metadata and controls
59 lines (51 loc) · 2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="DropShipAPI.WebForm1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("#Label1").click(function () {
var txt = $(this).html();
//var json = {"products":[{"warehouse":"Mwave Warehouse","products":[{"inStock":3,"packages":[{"qty":3,"weight":1,"height":10,"width":10,"length":10,"unit":1,"upc":"B0736J539T","sku":"B0736J539T"}]}]}]};
var obj = jQuery.parseJSON(txt);
//alert(obj.products);
console.log(obj);
var result = txt.replace('{', " <br />");
result = result.replace('[{', " <br />");
result = result.replace(':[{', ": <br />");
//result = result.replace('":"', '": <br />"');
result = result.replace(',',", <br />")
//result = result.replace('":',"$&\n" );
result = result.replace(',"',', <br />"');
document.getElementById("demo").innerHTML = result;
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<br />
<asp:Label ID="LabelSKU" runat="server" text="SKU" />
<br />
<asp:TextBox ID="SKUTxt" runat="server" />
<br />
<br />
<asp:Label ID="LabelUPC" runat="server" text="UPC" />
<br />
<asp:TextBox ID="UPCTxt" runat="server" />
<br />
<br />
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
<br />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<p id="demo"></p>
<br />
<div id="abc">
</div>
</div>
</form>
</body>
</html>