내 자바 스크립트가 작동하지 않는 이유를 알 수 없습니다. 태그에 값을 동적으로 전달하고 있습니다.

user2946613

아래 코드가 있습니다.

 <html>
 <body>

 <script>
 var Orderid = 12345;
 var Quantity = 2;
 var Revenue = 10.50;
 var Red = NorthAmerica;
 var Blue = Canada;
 var Green = French;
 var Yellow = 20.00;

 document.write('<s' + 'cript language="JavaScript" src="http://jact.atdmt.com/jaction/JavaScriptTest/v3/ato.' + Orderid + '/[atm1.' + Quantity + '/atm2.' + Revenue + '/atc1.' + Red + '/atc2.' + Blue + '/atc3.' + Green + '/atc4.' + Yellow + ']"></s'+'cript>')

 document.write('<nos' + 'cript><iframe src="http://iact.atdmt.com/iaction/JavaScriptTest/v3/ato.' + Orderid + '/[atm1.' + Quantity + '/atm2.' + Revenue + '/atc1.' + Red + '/atc2.' + Blue + '/atc3.' + Green + '/atc4.' + Yellow + ']" width="1" height="1" frameborder="0" scrolling="No" marginheight="0" marginwidth="0" topmargin="0" leftmargin="0"></iframe></nosc' + 'ript>')
 </script>

 </body>
 </html>

그 목적은 웹 페이지에서 추적하기 위해 변수를 URL (액션 태그)에 전달하는 것입니다.

나는 항상 과거에 이렇게 해왔지만 어떤 이유로 내 액션 태그 (jact.atdmt.com 또는 iact.atdmt.com)가 이번에는 호출되지 않습니다. 내가 잡히지 않는 뭔가 잘못하고 있는가? 이상적으로는 위와 같은 형식을 계속 사용하고 싶습니다. 왜 작동하지 않는지 생각할 수 없습니다.

감사,

매트 K

해당 문자열 주위에 따옴표가 필요합니다. 그렇지 않으면 정의되지 않은 변수로 처리됩니다.

var Red = 'NorthAmerica';
var Blue = 'Canada';
var Green = 'French';

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

Related 관련 기사

뜨겁다태그

보관