Hi Guys
I am using the following script to pull in 10 UK postcodes into my page:
This works just fine. However, I want to pull in these postcodes into the following peice of javascript:
So, if my query returns 3 postcodes then the javascript script would look like:
How do I insert all the postcode from my query into the javascript in the format above?
Any help would be fully appreciated
Best regards
Rod from the UK
I am using the following script to pull in 10 UK postcodes into my page:
Code:
<%
sqlStrB = "Select TOP 10 * from postcodetable"
oRsBJ.Open sqlStrB, oDBConn
If oRsBJ.eof then
%>
Sorry there are no postcodes
<%
Else
%>
---
<%
Do while not oRsBJ.eof
postcode = oRsBJ("postcode")
%>
<%=postcode%>
<%
oRsBJ.MoveNext
loop
%>
---
<%
End If
%>
<%
oRsBJ.close
set oRsBJ = nothing
%>
Code:
<script type="text/javascript">
var locations = [
'POSTCODE, UK',
];
</script>
Code:
<script type="text/javascript">
var locations = [
'LU4 9LT, UK',
'HP2 5UY, UK',
'WD2 6TF, UK',
];
</script>
Any help would be fully appreciated
Best regards
Rod from the UK
Comment