Re: Using Javascript to rotate through web checkout shopping comparison surveys
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: Using Javascript to rotate through web checkout shopping comparison surveys

From: web.dev <web.dev.cs@gmail.com>
Date: Tue Feb 28 2006 - 00:22:55 CET

s...@competitiveedgeproducts.com wrote:
> Hello,
>
> I am trying to get my website checkout page to rotate / take turns
> displaying shopping comparison engine surveys rather than display them
> all 4 at the same time, thus overwhelming & annoying the customer.
>
> I tried to put together some code to rotate through a Bizrate,
> PriceGrabber, Shopping.com and Nextag survey, I have taken the survey
> code the shopping comparison engines gave and tried to put it in a
> random number script to make them rotate. I have replaced our account
> numbers with asterisks below. Being new to javascript, I obviously
> have some major syntax errors or something. Would anyone be so kind
> and friendly as to show me what I need to change on this code to get it
> to work?

>>From just skimming at the code, you'll be going through a lot of edits.
 Let's see if we can do some incremental changes til we reach the goal
we want. :)

> <SCRIPT language="JavaScript">

The language attribute is deprecated, use the type attribute instead:

<script type = "text/javascript">

> <!-- Reviews Code

HTML comment delimiters are unnecessary. If you want to comment, why
not just use javascript comment delimiters:

//reviews code

> <!-- BEGIN: BizRate Survey Invitation HTML -->

Remove HTML comment delimiters.

> <script language="JavaScript"
> src="https://eval.bizrate.com/js/pos_*****.js"
> type="text/javascript"></script>

Problem: You cannot have nested scripts.

> <!-- END: BizRate Survey Invitation HTML -->

Remove HTML comment delimiters

> <!-- PriceGrabber Merchant Evaluation Code --> <script
> language="javascript" type="text/javascript"><!-- popup_pos_x=200;
> popup_pos_y=20; popup_title_color = "#000080"; popup_title_font_color =
> "#FFFFFF"; //--> </script> <script language="javascript"
> src="https://www.pricegrabber.com/rating_merchrevpopjs.php?retid=****"
> type="text/javascript"></script>

Remove HTML comment delimiters and move the script tag outside.

> <NOSCRIPT>
> <A
> href="https://www.pricegrabber.com/rating_merchrevpop.php?retid=****"
> target=_blank>
> <img src="https://images.pricegrabber.com/images/rating_merchpopup.gif"
>
> border="0" width="480" height="166" alt="Merchant
> Evaluation"></A></NOSCRIPT>

Problem: You are now mixing javascript code with HTML. HTML code is
separate from javascript.

> <!-- End PriceGrabber Code -->

Remove HTML comment delimiter.

> if(rand < 0.75)
>
> <iframe width="0" height="0"
> src="https://merchants.nextag.com/seller/review/popup.jsp?id=*******"></iframe>

Problem: Mixing HTML and javascript code again.

> <script language="JavaScript"
>
> src="https://www.shopping.com/xMerchantSurvey.js?pt=js&direct=1&mid=******">
>
> </script>

Problem: another nested script.

> // -->

Finally, remove the above as well. This will be our first step to
getting to your goal. After you have cleaned up the code above, post
the new changes and we can proceed from there.
Received on Mon May 1 03:40:15 2006