Code Man To The Rescue

BRK » 01 May 2008 » In Blog, Troubleshooting »

Number Uno: WTF is wrong with our Search? We’ve used the default search widget, our custom Google widget, and two addon widgets. All of them go to PayPal when we try to seach. We don’t have a clue how to fix this.

Numer Dos: The Powered by WoWHead code has changed.

This:

<script src=”http://www.wowhead.com/widgets/power.js”></script>

Does not work anymore. Update your html to:

<script src=”http://www.wowhead.com/widgets/power.js?lol”></script>

We don’t know the in-and-outs of why this works, but it does. We couldn’t get our WoWHead links to work until we implemented this change.

Comments

13 Responses to “Code Man To The Rescue”

  1. Mindrinne on May 1st, 2008 7:45 pm

    Have you tried moving the search above the For Sharvan area? It wouldn’t surprise me if it’s something to do with the funky way in which the Google search form is posting

  2. Sibohan on May 1st, 2008 7:54 pm

    Beats me. I’d actually encourage you to get away from all the scripts for any site having to do with WoW.

    As for the search, it looks like the PayPal form tag is not self-closed. That means the PayPal donation and Google search will get all munged together when the browser hits the final /form.

  3. acedanger on May 1st, 2008 8:03 pm

    BRK, you change the URL of the javascript to force the browser to download the new js file because the browser looks in it’s cache and doesn’t see it, decides it’s new and downloads it. that’s how you force all of your visitors to download the updated script. if all of your visitors visited your site and forced a refresh (by pressing Ctrl+F5), then you wouldn’t have to change to URL to the js file. Close that PayPal form tag as Sibohan said and the search should work as it should…i’m guessing. :)

  4. OrigamiSlayer on May 1st, 2008 8:06 pm

    The ?lol thing is just something to force the old javascript out of you and your users’ browser cache. Browsers will hang onto some things forever, whether you want them or not, and adding a ?something on the end doesn’t affect the script at all but lets your browser know “Hey! This is new! I better go download that and put that in my cache for later!” (That’s probably IE. Firefox would be far more casual about it).

    The only real alternative to the ?whatever trick would be to kindly ask all your readers to clear their cache, which is probably never gonna happen, or change the name of the script entirely, which is much harder to do when it’s not your script.

  5. Exelus on May 1st, 2008 8:07 pm

    The question mark at the end of a web URL means “hey, I might be a dynamic webpage, go fetch new stuff based on the lol parameter.” In this case, lol has no real meaning so the net effect is an updated copy of power.js sent back to your browser. :)

  6. Itsnoteasy on May 1st, 2008 8:54 pm

    Note: this post contains some HTML code. If it isn’t posted properly, or gets eaten by the blog, I’ll email you details.

    Ok, here’s why the search is failing:

    Long version: in HTML, there are a number of different elements you can use to construct a form. In addition to regular “button” elements, there are “submit” and “reset” buttons. The idea is that you have all your fields, and then you have a “submit” button. The “submit” button will automatically process the form based on the “form” element that you are supposed to use to wrap all your form fields.

    So you can have multiple forms on the same page, so long as they are each contained within their own “form” elements.

    Here’s the catch: your PayPal form doesn’t have a closing tag, so it never ends. This means it’s taken over your search input box and submit button.

    You need to put a closing “” tag into your PayPal code, between the element with all the gibberish in it and the closing “” tag just after it.

    Short version: you need to put “” into your PayPal code just before the following:

  7. Itsnoteasy on May 1st, 2008 9:02 pm

    Ack; comment form ate the HTML. I’ve sent you an email with the details.

    Yes, I know you have a comment editing thing, but I run NoScript.

    No, I don’t not trust you, it’s just that Firefox 3 crashes on your site if I don’t.

    No, I don’t know why.

    No, I don’t think it’s your fault.

    No, I don’t think it’s strange that I’m holding a conversation with myself in your blog comments. Stop looking at me like that!

    :D

  8. wow2b on May 1st, 2008 9:25 pm

    Sounds like you need a closing form tag at the end of your paypal plugin/widget. Thats all.

  9. Itsnoteasy on May 1st, 2008 9:53 pm

    @wow2b: Ah, but if he just put it at the end, then the form tag would be badly nested, and that can cause even more problems. He needs to put the closing tag in the middle of the widget, in a somewhat awkward spot.

    This problem wouldn’t even be *possible* if we could just kill Internet Explorer. Stupid horribly broken XHTML support, grumble grumble.

  10. BRK on May 1st, 2008 11:36 pm

    Fixed. Gracias to you all.

  11. Thunderbore and Thundercat on May 2nd, 2008 12:09 am

    Darth Prowes. Kick ass!

  12. wow2b on May 2nd, 2008 10:12 am

    @ Itsnoteasy

    Couldn’t have been that hard…he fixed it…;-)

  13. Delos The Laser Chicken on May 2nd, 2008 10:41 am

    Just a note to anyone who copied it over to your blogspot blog and found it still didn’t work. When you copy/paste it puts some odd version of quote marks in there that blogger doesnt understand, so blogger puts it’s own quote marks around it. You end up with 2 sets of quote marks and it doesnt work. Just erase the copied ones (they look like they are quote marks in italics) and type in blogger’s preferred quotes.

Leave a Reply