SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Jun 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    HTML newbie needing help with .asp

    Hello everybody,

    I'm kind of teaching myself html as I code the webpages for my site. I want to embed an .asp call into my webpage, to show the quantity in stock of a particular item.

    My distributor has provided 1 method, and I've found a couple other via google searching. None of the methods work

    I'm new to coding web pages, do I need to place any kind of java call in the header or something to get it to work? All I get displayed is:

    Stock:

    with no variable returned. Here's the complete section of my code, with 3 methods tried & none working:

    where "?id=" refers to the product ID, and "switch=1" calls up the quantity on hand at my distributor.


    <span style="color: rgb(255, 0, 0);"><span
    style="font-size: large;">
    Stock:
    <!-- 3rd Try -->
    <script>
    <% dim hkstock
    hktstock.open("GET", "http://www.mydistributor_api.asp?id=8731&amp;switch=1",true)
    Response.Write(hkstock)
    %>
    </script>
    <!-- 2nd Try -->
    <script>
    alert( <%=
    wwWebUtils.EncodeJsString("http://www.mydistributor_api.asp?id=8731&amp;switch=1")
    %>; );
    </script></span></span>

    <!-- 1st Try - code provided by distributor -->
    <!-- HK Scripts -->
    <script>
    var xmlhttp=false;
    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    xmlhttp.open("GET", "http://www.mydistributor_api.asp?id=8731&amp;switch=1",true);
    xmlhttp.onreadystatechange=function() {
    if (xmlhttp.readyState==4) {
    document.getElementById('testarea').innerHTML=xmlhttp.responseText;
    }
    }
    xmlhttp.send(null)
    </script>
    <!-- END HK Scripts -->
    <br>


    Thanks in advance!!

    Bill

  2. #2
    SitePoint Guru
    Join Date
    Jun 2007
    Posts
    691
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your distributor has sent you some javascript code. If it is not working you should seek help in a javascript forum.

  3. #3
    SitePoint Member
    Join Date
    Jun 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I realize that, but I have also tried using 2 different .asp methods as well. Neither is working.

  4. #4
    SitePoint Guru
    Join Date
    Jun 2007
    Posts
    691
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think you should stick with the distributor's recommendations and then review this:

    http://www.w3schools.com/xml/xml_http.asp

    rather than embarking on learning ASP for one task.

    The distributor should be able to answer any specific questions you may have since they are fully knowledgeable about the interface


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •