SitePoint Sponsor |
|
User Tag List
Results 1 to 10 of 10
Thread: 3 Col layout script problem
-
Mar 3, 2007, 09:05 #1
- Join Date
- Nov 2006
- Location
- London, England
- Posts
- 51
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
3 Col layout script problem
Hi!
I have a Wordpress blog athttp://www.vikingprincess.net"
In the Head tag in Header.php, I put a javascript that
makes all three columns in my theme equal height.
The script was recommended at Sitepoint and used to work fine on all pages. http://www.sitepoint.com/newsletter/...d=3&issue=70#7
Suddenly for no reason that I can spot, the javascript only gets executed when the root page is loaded. The root page is at http://www.vikingprincess.net. You know that the javascript was loaded if a little messagebox pops up! Also, obviously it was loaded if the columns are equal height.
However if I load any other page on the site, the javascript does not get called in header.php, and the column height is not adjusted. See <a www.vikingprincess.net/29/site-design-feedback-needed"
I don't know much about how javascript works, so I don't know how to troubleshoot this!
Please help if you can!
C.
-
Mar 3, 2007, 09:29 #2
- Join Date
- Nov 2004
- Location
- Nelson BC
- Posts
- 2,310
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
It seems like it's looking for x.js in the wrong folder...on the first page you explicitly point to
http://www.vikingprincess.net/wp-con...ugendstil/x.js
but on other pages you just point to
x.js
That's likely why it's not working.
-
Mar 3, 2007, 09:33 #3
- Join Date
- Nov 2006
- Location
- London, England
- Posts
- 51
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hi, thanks for responding. Actually, I only temporarily tried using the full path. For some reason that didn't work at all. When I move it back to just "x.js" the behaviour is back to what I described above..
-
Mar 3, 2007, 09:44 #4
- Join Date
- Nov 2004
- Location
- Nelson BC
- Posts
- 2,310
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Well on this page:
http://www.vikingprincess.net/29/sit...eedback-needed
I'm getting an error "Object Required" on line 49 which is:
xAddEventListener(window, "resize", adjustLayout, false);
I'd suggest creating a "scripts" folder in the root of the site where you store all your js files, and then reference it like:
<script src="/scripts/x.js" type="text/javascript"></script>
-
Mar 3, 2007, 10:04 #5
- Join Date
- Nov 2006
- Location
- London, England
- Posts
- 51
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hi!
Thanks! I'll definitely add the folder you mention.
How were you able to verify the JS?
I only verified the HTML, PHP and CSS which was ok.
I didn't know how to check the JS!
I use Dreamweaver.
Sounds like this something to follow up on. I just have to work out what I need to do!
-
Mar 3, 2007, 10:23 #6
- Join Date
- Nov 2004
- Location
- Nelson BC
- Posts
- 2,310
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I just use internet explorer 6 with all js error messages turned on, every time it hits an error I get a popup window thingy.
ps the Firefox Error Console is (lots) better than the IE error system. If you use Firefox check it out (under Tools)
-
Mar 3, 2007, 10:34 #7
- Join Date
- Nov 2006
- Location
- London, England
- Posts
- 51
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
the solution was to put
<script src="/x.js" type="text/javascript"></script>
instead of
<script src="x.js" type="text/javascript"></script>
Still no idea why the absolute path didn't work..
-
Mar 3, 2007, 13:02 #8
- Join Date
- Nov 2004
- Location
- Nelson BC
- Posts
- 2,310
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
absolute path
-
Mar 3, 2007, 17:00 #9
- Join Date
- Nov 2006
- Location
- London, England
- Posts
- 51
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks for the tips Jim! Yes, of course I use FF! Can't stand IE...
I haven't quite worked out how to use the developers tools such as Error Console.
I didn't see your two last posts until now...
Hmm, don't get that bit about absolute path. I could have sworn absolute path was the full path that could be used over the internet.. I'll have to look it up!
Thanks for helping!
-
Mar 3, 2007, 17:47 #10
- Join Date
- Dec 2002
- Location
- Alabama, USA
- Posts
- 2,560
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Jim is always right-on
For reference, here's a follow-up to that article.Cross-Browser.com, Home of the X Library
Bookmarks