Forum Moderators: open
Excuse me in advance for this question.
I placed in a page a VBScript to load an XML file (100k) to read some fields from it, and then write them into the content.
Now, it seems the page takes too much time to load.
My question is: Does the user browser request the whole 100k file? In other words, where does the VBScript run?
Thank you for your help;
Wilmer
This is a short form of the VBScript I made and placed into my pages:
............................
<body>
...
<script type="text/vbscript">
<!--
dim ID
ID="NNNN"
set xmlDoc=CreateObject("Microsoft.XMLDOM")
xmlDoc.async="false"
xmlDoc.load("exampledata.xml")
T="Title"
for each x in xmlDoc.documentElement.childNodes
if x.getAttribute("ProductID")=ID Then
document.write("<a href='http://example.com'>")
T=x.getAttribute("Title")
document.write(T & " : ")
document.write("$")
document.write(x.getAttribute("RetailPrice"))
document.write("</a><br>")
end If
next
-->
</script>
...
</body>
.............................
After I sent the first post, I think that may be it's better for loading time, doing this:
1. Import the datafeed to my PC
2. Bild static html pages with updated prices
2. Upload them to my host.
My pages are 30k to 50k, so my concern is all about if I'm increasing too much the loading time of my pages when using XML-DOM.
Again, thanks a lot for your help;
Wilmer
I did not try to run the script on the server. I do not know how to do that, and if it will work in my host service.
I’m afraid that I’ve got to read more about this topic and with time I will need some body that take care of my codes.
Thank you again for your help,
Wilmer
If they do, then converting your client side VBScript to a server-side ASP file is very simple and can be done quickly.
You can do this in 3 simple steps.
1. Change the file extension of your web page to .ASP
2. In a nutshell, change your <script> tags to ASP Tags like this:
<script language=vbscript> and </script> to
<% and %>
So, in other words, change
<script language=vbscript>
CODE
</script>
to
<%
CODE
%>
3. On the top of your web page file, add what they call the "directive":
<%@language="vbscript"%>
That really should be it. Since ASP works well with VBScript, JScript, or Javascript, your work besides those 3 steps is done.
I hope this helps.
Bruce