View Full Version : I give 10$ to the first man who can solve this problem
gbbortrad
12-02-2008, 06:20 PM
I have a javascript problem with my wordpress site and Internet Explorer:
http://www.borsatrading.net/
With firefox it is ok, with IE 7 it shows this javascript error (you can see the warning icon in the bottom left):
Line: 7
Character: 2
Error: 'null' is null or it is not an object
I use the Evolution theme and added a little bit of javascript from dynamic drive. It works everything but I want to remove that icon, because I hate it and it is not professional for my visitors.
You can find the external js and css checking my html source code.
I offer 10$ via paypal to the first who solve this problem.
Please, I need your help
Thank you
Kevin
12-03-2008, 01:19 AM
Was this error appearing before you added the code from dynamic drive?
sarahG
12-03-2008, 10:08 AM
The problem isn't with the JS you've added. You've changed one of the theme's original classes. For the top horizontal menu it was
<ul class="menu">
and you've changed this to
<ul class="my_menu">
The JavaScript error is stating that the target in the jQuery which is '.menu a' is null, as '.menu a' doesn't exist now.
To remove the error you need to open up the js/theme.js file in the theme directory and fine the line
$(".menu a").wrapInner(document.createElement("span"));
You can either just remove this line or comment it out, as it's clearly not required with your design now (put two forward slashes at the start of the line to comment it out - // )
Or if you want to update it to work with your changes you need to change it to be
$(".my_menu a").wrapInner(document.createElement("span"));
As you can see I've just changed the class name in the selector above.
gbbortrad
12-03-2008, 03:21 PM
Thanks Sarah for your reply.. I think you have found the problem... I commented the line:
$(document).ready(function() {
//$(".my_menu a").wrapInner(document.createElement("span"));
$(".post").wrap("<div class='post_c'><div class='post_b'>" + "</div></div>");
$(".widget").wrap("<div class='widget_c'>" + "</div>");
$(".widget_c").append("<div class='widget_b'></div>");
$("#search").prepend("<h2 style='text-align: left;'>Search</h2>");
});
but it still gives an error... I tried to comment all the lines like this:
/*
$(document).ready(function() {
$(".my_menu a").wrapInner(document.createElement("span"));
$(".post").wrap("<div class='post_c'><div class='post_b'>" + "</div></div>");
$(".widget").wrap("<div class='widget_c'>" + "</div>");
$(".widget_c").append("<div class='widget_b'></div>");
$("#search").prepend("<h2 style='text-align: left;'>Search</h2>");
});
*/
and it works in the homepage, but it doesn't work in the post page.
What can I do to solve this trouble?
Thank you Sarah you are very kind
sarahG
12-03-2008, 04:13 PM
The first solution fixed the first problem however you've renamed the .post class which is probably the next error you saw, so comment the first and second line out using either // or /* ... */
The error on your single post is related to your dynamic drive dropdowns JS.
However, that said, at the end of the day, if the site works then JS errors are not that major. Of course it means something is wrong somewhere, but unless a site stops working then they're not a major concern, more of a warning. A bit like PHP warnings. They're just warnings.
gbbortrad
12-03-2008, 05:02 PM
thank you Sarah... I removed the dropdown JS and edited theme.jg like this:
/*
$(document).ready(function() {
$(".my_menu a").wrapInner(document.createElement("span"));
$(".post").wrap("<div class='post_c'><div class='post_b'>" + "</div></div>");
$(".widget").wrap("<div class='widget_c'>" + "</div>");
$(".widget_c").append("<div class='widget_b'></div>");
$("#search").prepend("<h2 style='text-align: left;'>Search</h2>");
});
*/
it works everything
is there any problem if I don't call this js on my <head> tag? If it's all commented I better delete this file... Does the theme work all the same?
I'm writing you a private message for your paypal email so that I can pay you..
thank you Sarah you are very competent
sarahG
12-03-2008, 09:03 PM
By commenting out all of the JS, you've stopped some of the styles on your sites from being correctly applied. Mainly the widget boxes on the right are now missing their backgrounds. Just comment out the first two lines and it should be fine ie.
$(document).ready(function() {
//$(".my_menu a").wrapInner(document.createElement("span"));
//$(".post").wrap("<div class='post_c'><div class='post_b'>" + "</div></div>");
$(".widget").wrap("<div class='widget_c'>" + "</div>");
$(".widget_c").append("<div class='widget_b'></div>");
$("#search").prepend("<h2 style='text-align: left;'>Search</h2>");
});
And you don't have to pay to get help here ;)
gbbortrad
12-04-2008, 10:11 AM
I commented like this:
$(document).ready(function() {
//$(".my_menu a").wrapInner(document.createElement("span"));
//$(".post").wrap("<div class='post_c'><div class='post_b'>" + "</div></div>");
$(".widget").wrap("<div class='widget_c'>" + "</div>");
$(".widget_c").append("<div class='widget_b'></div>");
$("#search").prepend("<h2 style='text-align: left;'>Search</h2>"); });
but it still gives the same error. I didn't notice the backgrounds missing on the sidebar. Anyway even if I don't comment like this
$(document).ready(function() {
$(".my_menu a").wrapInner(document.createElement("span"));
$(".post").wrap("<div class='post_c'><div class='post_b'>" + "</div></div>");
$(".widget").wrap("<div class='widget_c'>" + "</div>");
$(".widget_c").append("<div class='widget_b'></div>");
$("#search").prepend("<h2 style='text-align: left;'>Search</h2>"); });
the backgrounds do not appear... Am I doing something wrong?
And please I really appreciate your help, so I would be glad if I can pay you for your help... I owe it to you
sarahG
12-04-2008, 11:22 AM
The backgrounds won't be appearing as the javascript is erroring and it then stops. Instead of commenting the other lines, just delete those that aren't needed ie. the .post line. Also delete the last line of $("#search")... as that's not actually doing anything either (as there's nothing with an ID of search on the page).
So this should then leave you with
$(document).ready(function() {
$(".my_menu a").wrapInner(document.createElement("span"));
$(".widget, .widget_chat").wrap("<div class='widget_c'>" + "</div>");
$(".widget_c").append("<div class='widget_b'></div>");
});
I've also amended the second line to target both .widget and .widget_chat as you've used the second class around the two boxes above your tabs box (with the categories, archives and recent comments), so this way it's consistent.
That should work, however of course put it in the theme.js file and let me know and I'll check it over with my JS checker.
gbbortrad
12-04-2008, 01:39 PM
it doesn't work this way :-) it gives always the same error, line 7 character 2
this is my theme.js file
/*
* You can add any Javascript here.
*/
$(document).ready(function() {
$(".my_menu a").wrapInner(document.createElement("span"));
$(".widget, .widget_chat").wrap("<div class='widget_c'>" + "</div>");
$(".widget_c").append("<div class='widget_b'></div>");
});
I tried to delete my cache but it doesn't work
sarahG
12-04-2008, 04:18 PM
Remove the line
$(".my_menu a").wrapInner(document.createElement("span"));
gbbortrad
12-04-2008, 10:57 PM
Still gives the same error :-)
sarahG
12-05-2008, 09:43 AM
Heh, I give up then. You've made too many changes and something has caused something else to stop working I'm afraid. If you've happy with the way things look, just remove the theme.js file and take the call to it out of the header.js file. I'd also remove the call to jQuery above it too as that won't be needed either.
You have a second JS error from a script that seems to be getting called from another site. Something to do with boxtag?
Sorry I can't fix your problem, but the error and the sourcecode say two different things, so something else is causing the problem, possibly one of your other javascripts that you've added, and it's all clashing.
gbbortrad
12-05-2008, 12:45 PM
I removed the two js and solved the backgroun problem just adding #F5F7EC to those class in the css:
.widget {
background: #F5F7EC url(images/side_h1.jpg) no-repeat;
padding: 9px 13px 5px 15px;
}
.widget_chat {
background: #F5F7EC url(images/side_h1.jpg) no-repeat;
padding: 9px 0px 5px 2px;
}
:-) no more js error now.. thank you Sarah you are the best
vBulletin® v3.8.3, Copyright ©2000-2012, Jelsoft Enterprises Ltd.