Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

MouseOver Problem

Participant ,
Nov 06, 2008 Nov 06, 2008
I have a set of links, that have a mouseOver added to:

<a href="search_by_location.php?rest_city=<?php echo "$row_jobs_locations[city_name]"; ?>" onMouseOver="<?php echo trim(preg_replace('#[^\p{L}\p{N}]+#u', '', $row_jobs_locations['city_name'])); ?>()" onMouseOut="mouseOut()"><?php echo $row_jobs_locations['city_name']; ?> </a>

On mouseOver it loads the image that I need it to display for a DIV named "map"

The function for this is stored in "js/map.js":
function Aberdeen()
{
document.map.src ="images/Aberdeen.jpg";
}
function AyreKilmarnockIrvine()
{
document.map.src ="images/AyreKilmarnockIrvine.jpg";
}
function BarnsleyDoncasterRotherham()
{
document.map.src ="images/BarnsleyDoncasterRotherham.jpg";
}
function BasingstokeFleet()
{
document.map.src ="images/BasingstokeFleet.jpg";
}
function Bath()
{
document.map.src ="images/Bath.jpg";
}

Now when I text this on my local machine the images change. But on my server when I rollover the hyperlink it stays on the default image.

View site: site site

Also using the W3C html validator I get errors from my javascript for <a></a> tags saying they are open or not closed.

But the tags are like this: '<a href="index.php">sumthing</a>'
TOPICS
Server side applications
461
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 06, 2008 Nov 06, 2008
Your mouseovers are being written to the page as blanks -

<td><div class="smallTextCount"><a
href="search_by_location.php?rest_city=Bromley & Bexley" onMouseOver="()"
onMouseOut="mouseOut()">Bromley & Bexley </a>(0)</div></td>
</tr><tr>

Check your PHP markup.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"The_FedEx_Guy" <webforumsuser@macromedia.com> wrote in message
news:gev7rr$14p$1@forums.macromedia.com...
>I have a set of links, that have a mouseOver added to:
>
> <a href="search_by_location.php?rest_city=<?php echo
> "$row_jobs_locations[city_name]"; ?>" onMouseOver="<?php echo
> trim(preg_replace('#[^\p{L}\p{N}]+#u', '',
> $row_jobs_locations['city_name']));
> ?>()" onMouseOut="mouseOut()"><?php echo $row_jobs_locations['city_name'];
> ?>
> </a>
>
> On mouseOver it loads the image that I need it to display for a DIV named
> "map"
>
> The function for this is stored in "js/map.js":
> function Aberdeen()
> {
> document.map.src ="images/Aberdeen.jpg";
> }
> function AyreKilmarnockIrvine()
> {
> document.map.src ="images/AyreKilmarnockIrvine.jpg";
> }
> function BarnsleyDoncasterRotherham()
> {
> document.map.src ="images/BarnsleyDoncasterRotherham.jpg";
> }
> function BasingstokeFleet()
> {
> document.map.src ="images/BasingstokeFleet.jpg";
> }
> function Bath()
> {
> document.map.src ="images/Bath.jpg";
> }
>
> Now when I text this on my local machine the images change. But on my
> server
> when I rollover the hyperlink it stays on the default image.
>
> View site: site http://www.joyruljobs.com
>
> Also using the W3C html validator I get errors from my javascript for
> <a></a>
> tags saying they are open or not closed.
>
> But the tags are like this: '<a href="index.php">sumthing</a>'
>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 07, 2008 Nov 07, 2008
Then how does it work on my local machine then?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 07, 2008 Nov 07, 2008
It seems to be this line of PHP which is failing

<?php echo trim(preg_replace('#[^\p{L}\p{N}]+#u', '', $row_jobs_locations['city_name'])); ?>

It's not obvious what you're trying to do and I don't have time to play with your regex (sorry). Try using this site

http://www.switchplane.com/utilities/preg_match_regular_expression_tester.php

and/or display all errors and warnings on the testing server.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 07, 2008 Nov 07, 2008
I have changed it to this:

<a href="search_by_location.php?rest_city=<?php echo "$row_jobs_locations[city_name]"; ?>" onMouseOver="<?php echo trim(preg_replace('#[^\p{L}\p{N}a-zA-Z0-9]+#u', '', $row_jobs_locations['city_name'])); ?>()" onMouseOut="mouseOut()"><?php echo $row_jobs_locations['city_name']; ?> </a>

Can anyone explain why the server didnt accept the what I had coded it already.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 07, 2008 Nov 07, 2008
LATEST
Not me. I find it hard enough to read my own regex.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines