English
  • Login
  • |
  • Register

External call

Example effect
Sample:CF510638224DE
Example explanation

ContainerId

Required, Specify the container ID of the carrier content.

Height

Optional, specify tracking result height, default is 600px.

Width

Optional, specify tracking result width, default is 450px.

Num

Required, specify the number needed to be tracked.

Call code
  • <!--tracking input box-->
  • <input type= "text"id ="trackingNum"maxlength ="50" value = "CF510638224DE"/>
  • <!--Button to call script method-->
  • <input type= "button"value="TRACK"onclick="doTrack()">
  • <!--Container for displaying query results-->
  • <div id= "TRContainer"></div>
  • <!--The script code can be placed at the bottom of the page and wait until the end of the page.-->
  • <script type = "text/javascript">
  • functiondoTrack(){
  • var TRnode = document.querySelector("#TRContainer");
  • var num = document.querySelector("#trackingNum").value.trim();
  • var childHeight = 600;//Can set it yourself
  • var childWidth = 650;//Can set it yourself
  • if(num ===""){
  • alert("Enter your number.");
  • return;
  • }
  • if(TRnode.childNodes.length > 0){
  • TRnode.removeChild(TRnode.childNodes[0]);
  • }
  • var myIframe = document.createElement('iframe');
  • myIframe.setAttribute("src", 'https://www.1tracking.net/extcall/index.html#num=' + num + '&width=' + childWidth + '&height=' + childHeight);
  • myIframe.setAttribute("frameborder", 0)
  • myIframe.setAttribute("height", childHeight)
  • myIframe.setAttribute("width", childWidth)
  • TRnode.appendChild(myIframe);
  • }
  • </script>
Copy Code