Javascript inside Jumi module affecting the module beneath

A multipurpose module, plugin and component

Javascript inside Jumi module affecting the module beneath

New postby [email protected] » Wed Dec 01, 2010 9:11 pm

I have placed some Javascript inside a module called Flag of the Day on the Home page of my Joomla 1.5 website:

http://www.balcombevillage.co.uk/joomlatest/

The link of the flag has spread down to the header of the Login module beneath.

Here is the Javascript inside the Jumi module (note: this script works fine on it's own or placed inside an article using Jumi).

I know Javascript is a complex area, but perhaps someone can notice a glaring error?

TIA

<script type="text/javascript">
<!-- Beginning of JavaScript -
today=new Date(); //determines the current date

day1 = 11; //day of commemoration
month1 = 11; //month of commemoration
day2 = 27;
month2 = 1;
day3 = 12;
month3 = 2;
day4 = 1;
month4 = 3;
day5 = 8;
month5 = 3;
day6 = 22;
month6 = 3;
day7 = 7;
month7 = 4;
day8 = 9;
month8 = 5;
day9 = 20;
month9 = 5;
day10 = 5;
month10 = 6;
day11 = 21;
month11 = 9;
day12 = 1;
month12 = 10;
day13 = 4;
month13 = 10;
day14 = 16;
month14 = 10;
day15 = 24;
month15 = 10;
day16 = 25;
month16 = 10;
day17 = 20;
month17 = 11;
day18 = 1;
month18 = 12;
day19 = 10;
month19 = 12;
day20 = 21;
month20 = 6;

/*if the current date shown above, then your special image is displayed. Otherwise your default image is displayed. Be sure to include width and height tags for NN2*/

if ((today.getDate() == day1) && (today.getMonth() == (month1 - 1)))
{document.write("<A HREF='http://en.wikipedia.org/wiki/Remembrance_Day/' TITLE='Remembrance Day.' ALIGN='centre'><IMG SRC='http://www.balcombevillage.co.uk/commemorations/RemembranceDay.gif' WIDTH='156' HEIGHT='95' ALIGN='TOP'>")}
else if ((today.getDate() == day2) && (today.getMonth() == (month2 - 1)))
{document.write("<A HREF='http://www.hmd.org.uk/' TITLE='Holocaust Memorial Day.' ALIGN='centre'><IMG SRC='http://www.balcombevillage.co.uk/commemorations/HolocaustMemorialDay.gif' WIDTH='156' HEIGHT='95' ALIGN='TOP'>")}
else if ((today.getDate() == day3) && (today.getMonth() == (month3 - 1)))
{document.write("<A HREF='http://www.darwin200.org/' TITLE='Darwin Day.' ALIGN='centre'><IMG SRC='http://www.balcombevillage.co.uk/commemorations/DarwinDay.gif' WIDTH='156' HEIGHT='95' ALIGN='TOP'>")}
else if ((today.getDate() == day4) && (today.getMonth() == (month4 - 1)))
{document.write("<A HREF='http://www.worldbookday.com/' TITLE='World Book Day.' ALIGN='centre'><IMG SRC='http://www.balcombevillage.co.uk/commemorations/WorldBookDay.gif' WIDTH='156' HEIGHT='95' ALIGN='TOP'>")}
else if ((today.getDate() == day5) && (today.getMonth() == (month5 - 1)))
{document.write("<A HREF='http://www.internationalwomensday.com/' TITLE='International Women's Day.' ALIGN='centre'><IMG SRC='http://www.balcombevillage.co.uk/commemorations/InternationalWomensDay.gif' WIDTH='156' HEIGHT='95' ALIGN='TOP'>")}
else if ((today.getDate() == day6) && (today.getMonth() == (month6 - 1)))
{document.write("<A HREF='http://www.worldwaterday.org/' TITLE='World Water Day.' ALIGN='centre'><IMG SRC='http://www.balcombevillage.co.uk/commemorations/WorldWaterDay.gif' WIDTH='156' HEIGHT='95' ALIGN='TOP'>")}
else if ((today.getDate() == day7) && (today.getMonth() == (month7 - 1)))
{document.write("<A HREF='http://www.who.int/world-health-day/en/index.html' TITLE='World Health Day.' ALIGN='centre'><IMG SRC='http://www.balcombevillage.co.uk/commemorations/WorldHealthDay.gif' WIDTH='156' HEIGHT='95' ALIGN='TOP'>")}
else if ((today.getDate() == day8) && (today.getMonth() == (month8 - 1)))
{document.write("A HREF='http://www.eurunion.org/welcome/EuropeDay.htm' TITLE='Europe Day.' ALIGN='centre'><IMG SRC='http://www.balcombevillage.co.uk/commemorations/EuropeDay.gif' WIDTH='156' HEIGHT='95' ALIGN='TOP'>")}
else if ((today.getDate() == day9) && (today.getMonth() == (month9 - 1)))
{document.write("<A HREF='http://www.un.org/Depts/dhl/cultural_diversity/index.html' TITLE='Cultural Diversity Day.' ALIGN='centre'><IMG SRC='http://www.balcombevillage.co.uk/commemorations/CulturalDiversityDay.gif' WIDTH='156' HEIGHT='95' ALIGN='TOP'>")}
else if ((today.getDate() == day10) && (today.getMonth() == (month10 - 1)))
{document.write("<A HREF='http://www.unep.org/wed/2008/english/' TITLE='World Environment Day.' ALIGN='centre'><IMG SRC='http://www.balcombevillage.co.uk/commemorations/WorldEnvironmentDay.gif' WIDTH='156' HEIGHT='95' ALIGN='TOP'>")}
else if ((today.getDate() == day11) && (today.getMonth() == (month11 - 1)))
{document.write("<A HREF='http://www.un.org/events/peaceday/2007/index.shtml' TITLE='International Day of Peace.' ALIGN='centre'><IMG SRC='http://www.balcombevillage.co.uk/commemorations/InternationalDayOfPeace.gif' WIDTH='156' HEIGHT='95' ALIGN='TOP'>")}
else if ((today.getDate() == day12) && (today.getMonth() == (month12 - 1)))
{document.write("<A HREF='http://www.unesco.org/imc/site.php?typ=11&subsite=15' TITLE='International Music Day.' ALIGN='centre'><IMG SRC='http://www.balcombevillage.co.uk/commemorations/InternationalMusicDay.gif' WIDTH='156' HEIGHT='95' ALIGN='TOP'>")}
else if ((today.getDate() == day13) && (today.getMonth() == (month13 - 1)))
{document.write("<A HREF='http://www.worldanimalday.org.uk/index.asp' TITLE='World Animal Day.' ALIGN='centre'><IMG SRC='http://www.balcombevillage.co.uk/commemorations/WorldAnimalDay.gif' WIDTH='156' HEIGHT='95' ALIGN='TOP'>")}
else if ((today.getDate() == day14) && (today.getMonth() == (month14 - 1)))
{document.write("<A HREF='http://www.fao.org/wfd2007/index_en.html' TITLE='World Food Day.' ALIGN='centre'><IMG SRC='http://www.balcombevillage.co.uk/commemorations/WorldFoodDay.gif' WIDTH='156' HEIGHT='95' ALIGN='TOP'>")}
else if ((today.getDate() == day15) && (today.getMonth() == (month15 - 1)))
{document.write("<A HREF='http://www.un.org/events/unday/2007/' TITLE='United Nations Day.' ALIGN='centre'><IMG SRC='http://www.balcombevillage.co.uk/commemorations/UnitedNationsDay.gif' WIDTH='156' HEIGHT='95' ALIGN='TOP'>")}
else if ((today.getDate() == day16) && (today.getMonth() == (month16 - 1)))
{document.write("<A HREF='http://www.artistsforabetterworld.org/index.php?category=99' TITLE='International Art Day.' ALIGN='centre'><IMG SRC='http://www.balcombevillage.co.uk/commemorations/InternationalArtDay.gif' WIDTH='156' HEIGHT='95' ALIGN='TOP'>")}
else if ((today.getDate() == day17) && (today.getMonth() == (month17 - 1)))
{document.write("<A HREF='http://www.un.org/Depts/dhl/children_day/' TITLE='Universal Children's Day Day.' ALIGN='centre'><IMG SRC='http://www.balcombevillage.co.uk/commemorations/UniversalChildrensDay.gif' WIDTH='156' HEIGHT='95' ALIGN='TOP'>")}
else if ((today.getDate() == day18) && (today.getMonth() == (month18 - 1)))
{document.write("<A HREF='http://www.worldaidsday.org' TITLE='World AIDs Day.' ALIGN='centre'><IMG SRC='http://www.balcombevillage.co.uk/commemorations/WorldAIDS_Day.gif' WIDTH='156' HEIGHT='95' ALIGN='TOP'>")}
else if ((today.getDate() == day19) && (today.getMonth() == (month19 - 1)))
{document.write("<A HREF='http://www.un.org/depts/dhl/humanrights/' TITLE='International Human Rights Day.' ALIGN='centre'><IMG SRC='http://www.balcombevillage.co.uk/commemorations/InternationalHumanRightsDay.gif' WIDTH='156' HEIGHT='95' ALIGN='TOP'>")}
else if ((today.getDate() == day20) && (today.getMonth() == (month20 - 1)))
{document.write("<A HREF='http://en.wikipedia.org/wiki/World_Humanist_Day' TITLE='World Humanist Day.' ALIGN='centre'><IMG SRC='http://www.balcombevillage.co.uk/commemorations/WorldHumanistDay.gif' WIDTH='156' HEIGHT='95' ALIGN='TOP'>")}
else {document.write("<A HREF='http://www.balcombevillage.co.uk/joomlatest/index.php?option=com_content&view=article&id=148' TITLE='This flag is replaced by the United Nations flag on certain international commemorative days. Click here for a list and the history of the Balcombe flag.' ALIGN='centre'><IMG SRC='http://www.balcombevillage.co.uk/commemorations/BalcombeFlag.gif' WIDTH='156' HEIGHT='95' ALIGN='TOP'>")}
// - End of JavaScript - -->
</script>
[email protected]
 
Posts: 8
Joined: Sun Nov 21, 2010 6:16 pm

Re: Javascript inside Jumi module affecting the module benea

New postby [email protected] » Thu Dec 02, 2010 12:28 am

I've just noticed this error is only in Mozilla Firefox browser.
[email protected]
 
Posts: 8
Joined: Sun Nov 21, 2010 6:16 pm

Re: Javascript inside Jumi module affecting the module benea

New postby Edvard » Thu Dec 02, 2010 2:43 pm

Do you see exactly the same code in your site's source code when you put it inside jumi module?
Regards,

Edvard Ananyan - 2GLux Team

Please post a review at the Joomla Extensions Directory. It is very important for us!
Edvard
Site Admin
 
Posts: 1836
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: Javascript inside Jumi module affecting the module benea

New postby [email protected] » Thu Dec 02, 2010 8:05 pm

Good idea, but I compared them using Word compare and found no differences.
[email protected]
 
Posts: 8
Joined: Sun Nov 21, 2010 6:16 pm

Re: Javascript inside Jumi module affecting the module benea

New postby Edvard » Fri Dec 03, 2010 12:27 am

I've just checked your site and seems that you made it work. What was the issue?
Regards,

Edvard Ananyan - 2GLux Team

Please post a review at the Joomla Extensions Directory. It is very important for us!
Edvard
Site Admin
 
Posts: 1836
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: Javascript inside Jumi module affecting the module benea

New postby [email protected] » Fri Dec 24, 2010 5:16 pm

It works in IE.

In Firefox, the header of the module below is affected. The link has changed to that of the flag module above.
[email protected]
 
Posts: 8
Joined: Sun Nov 21, 2010 6:16 pm


Return to Jumi

Who is online

Users browsing this forum: No registered users and 1 guest

cron