dingoegret
Programmer
- Dec 22, 2011
- 3
Okay first things first. Firebug this website [URL unfurl="true"]http://www.locksmith.com/[/url]
You will see that they have a script in the head tag. That script is:
They also have a form. That form is:
When you enter your zip code into that form, I think it is passed to the el.src variable as a parsed string and sent to s.yext-listings.com/ like this://s.yext-listings.com/yext?aid=74qWXpBkYak%3D&city=&state=&zip=INSERT_ZIP_CODE_PASSED_FROM_THE_FORM_HERE&latitude=&longitude=
When you click the submit button on the form with an input zip code, it takes you to a page where there is a huge DIV block with this script executing inside it:
Well the result on the second page is a listing pulled from a database and laid out in the second page in a DIV block.
My question! How do I emulate this on my website? I have the Yext service. I have been on the phone with the company for over a week now and I cant get any technical support on the integration. Apparently they are having a lot of lay offs and technical support is unavailable.
I am assuming that I need to build a form in HTML and have it pass the zip code to that JavaScript snippet somehow? I also want to know how the JavaScript on the second page renders a listing result from that passed form value?
Thank you so much for the help in advance. I know you guys can figure this out before I do.
You will see that they have a script in the head tag. That script is:
<script class="yext-synd-74qWXpBkYak=">
(function () {
var el = document.createElement('script');
el.async = true;
el.src = '//s.yext-listings.com/yext?aid=74qWXpBkYak%3D&city=&state=&zip=&latitude=&longitude=';
(document.getElementsByTagName('head')[0] ||
document.getElementsByTagName('body')[0]).appendChild(el);
})();
</script>
They also have a form. That form is:
<form title="Enter your zip and find a qualified, local locksmith" action="results.asp" method="POST">
<p><font style="font-size: 19px; font-weight: 700">FIND A LOCKSMITH</font>
<input type="text" value="14646" style="font-family: Arial; font-size: 22px; color: #666666; font-weight:bold;" onclick="this.value=''" size="5" name="zip">
<input type="image" style="position: relative; top:5px" name="B1" src="images/smallgo2.jpg">
</p>
</form>
When you enter your zip code into that form, I think it is passed to the el.src variable as a parsed string and sent to s.yext-listings.com/ like this://s.yext-listings.com/yext?aid=74qWXpBkYak%3D&city=&state=&zip=INSERT_ZIP_CODE_PASSED_FROM_THE_FORM_HERE&latitude=&longitude=
When you click the submit button on the form with an input zip code, it takes you to a page where there is a huge DIV block with this script executing inside it:
<script class="yext-synd-74qWXpBkYak=">
(function () {
var el = document.createElement('script');
el.async = true;
el.src = '//s.yext-listings.com/yext?aid=74qWXpBkYak%3D&city=&state=&zip=33405&latitude=&longitude=';
(document.getElementsByTagName('head')[0] ||
document.getElementsByTagName('body')[0]).appendChild(el);
})();
</script>
Well the result on the second page is a listing pulled from a database and laid out in the second page in a DIV block.
My question! How do I emulate this on my website? I have the Yext service. I have been on the phone with the company for over a week now and I cant get any technical support on the integration. Apparently they are having a lot of lay offs and technical support is unavailable.
I am assuming that I need to build a form in HTML and have it pass the zip code to that JavaScript snippet somehow? I also want to know how the JavaScript on the second page renders a listing result from that passed form value?
Thank you so much for the help in advance. I know you guys can figure this out before I do.