View Single Post
  #7 (permalink)  
Old 05-09-2008, 04:17 PM
Sherman Pendley
Guest
 
Posts: n/a
Diggs:
Default Re: My Very Strange Webhost, SBI! -- Opinions, Please

Ben C <spamspam@spam.eggs> writes:

> On 2008-05-08, Prisoner at War <prisoner_at_war@yahoo.com> wrote:
>>
>> Friends, your opinions and advice, please:
>>
>> I have a very simple JavaScript image-swap which works on my end but
>> when uploaded to my host at http://buildit.sitesell.com/sunnyside.html
>> does not work.
>>
>> To rule out all possible factors, I made up a dummy page for an
>> index.html to upload, along the lines of <html><head><title></title></
>> head><body></body></html>.; the image-swap itself is your basic <img
>> src="blah.png" onMouseOver="bleh.gif" onMouseOut="blah.png">.

>
> Doesn't onmouseover etc. have to be a script, not just the name of
> another image?


One could write a popup script that would scan the DOM in the domReady
event, and replace the image names with real event handler closures
that load the named images.

I'm doing a similar feature on a site I'm working on right now - I
include a script at the top of the page, and links that include a "rel"
attribute value are modified through the DOM to add an onClick event
that is handled by loading the target with AJAX and displaying it in a
popup div.

Since the pieces that make the page reliant on JavaScript are added by
a JavaScript event handler, on browsers that don't do JavaScript by
design or by user choice, the links will remain ordinary links. That
makes this technique a good way to build in a graceful fallback.

Perhaps Prisoner was using a script at one time that did this kind of
on the fly modification, and is now using one for which he needs to
insert a more traditional function call into the event attributes.

>> Now I contacted their customer/tech support, and only after three days
>> with the third rep was it acknowledged that I had a problem which they
>> ought to look into (at first they did the usual tech support thing
>> and, upon seeing the keyword "JavaScript" immediately disavowed any
>> responsibility for my situation, as if I was calling about third-party
>> software or something like that).

>
> It's not like the JavaScript is running on their server, so it shouldn't
> make any difference to them.


This is a free hosting service, right? They could be inserting content,
like banner ads or something, in return for free hosting. I can well
imagine a banner ad with a mouseover script. And I can well imagine a
mouseover script being packaged this way. It needs JavaScript to
function anyway, so using JS to connect the event handlers is no
additional burden. It's certainly valid HTML. And it's a bit less
error prone; end users can use it who don't know a bit of JavaScript.

sherm--

--
My blog: http://shermspace.blogspot.com
Cocoa programming in Perl: http://camelbones.sourceforge.net
Reply With Quote