Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
I'm working on this website: link
Everything works in the modern browsers, but in IE8 if I click on a plus sign in the left menu, I get an error.
The error is in the 52. line of this js: js
content = $(link).parent();
Error is
Object doesn't support property or method
From seeing your script,
togglemenu($(this));
function togglemenu(link){
content = $(link).parent();
...
...
}
you can directly have
content = link.parent();
Well content is not defined anywhere that I can see, maybe that is the problem?
Try this-:
$(link).closest('your closest parent')
Documentation=http://api.jquery.com/closest/
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
If I try the code below on the console in Chrome, it is working. But the code is not working in my Javascript extension in Chrome.
var region = document.getElementById("physicalDeliveryOfficeName");
region.removeAttribute("onchange");
Any thoughts what am I doing wrong? Tried to add this line in my function and on the top of my script but it is not working.
This is due to the execution environment that it is isolated in a Chrome extension.
You have to inject the code into the page to do modify the page context handlers.
Please see Insert code into the page context using a content script
It works in console because the dom has loaded. Wrap your code in an event handler.
document.addEventListener("DOMContentLoaded", function(event) {
var region = document.getElementById("physicalDeliveryOfficeName");
region.removeAttribute("onchange");
});
https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
Adding this line of code $("#locate-me-button").click(loadLocation()); breaks my entire JavaScript code file even if I don't click the #locate-me-button element. When this line is commented out the entire file works perfectly again. Why would that be?
You are invoking the function as passing its return value to event handler, just pass the function reference to .click()
$("#locate-me-button").click(loadLocation);
//^ () is removed
The another way (at least for case that you have parameter):
$("#locate-me-button").click(function(){
loadLocation();
});
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
as mentioned in the Title, when I load my Website on Firefox there seem to be rendering problems. Although when I load it on Chrome or Safari it looks and renders as it should.
I will post some screenshots to make the issue even clearer.
Many thanks in advance for your help.
Website view on Firefox
Website view on Chrome
Error on below line, correct it.
src: url(‘library/fonts/destroy_-webfont.eot');
Correction:
src: url('library/fonts/destroy_-webfont.eot');
Seems as if you are missing some css. Check to see if the css files are being loaded properly in the developer console. If they are being loaded correctly, then you may need to add some mozilla specific styles.
Are there any other errors in the browser console that would prevent execution of the css?
Welcome to the world of cross browser compatibility issues.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
I have tried the following codes to set a textbox property to readonly but none of them is working. Can anyone tell me how to do it?
document.getElementById("phone_numbers").disabled=true;
document.getElementById("phone_numbers").readonly=true;
document.getElementById("phone_numbers").readOnly=true;
document.getElementById("phone_numbers").readOnly=readOnly;
document.getElementById("phone_numbers").readOnly=readonly;
document.getElementById("phone_numbers").readonly=readonly;
document.getElementById("phone_numbers").readonly=readOnly;
document.getElementById("phone_numbers").setAttribute('readonly', 'readonly');
document.getElementById("phone_numbers").setAttribute("readonly", "true");
EDIT
While I was editing my question to write more detail I realized what the problem was. I made a silly mistake. This was my original HTML code.
<input name="phone_numbers">
And I changed it to
<input id="phone_numbers">
And it worked!
By the way following are the functions that are actually working.
document.getElementById("phone_numbers").disabled=true;
document.getElementById("phone_numbers").readOnly=true;
document.getElementById("phone_numbers").setAttribute('readonly', 'readonly');
document.getElementById("phone_numbers").setAttribute("readonly", "true");
Your third line worked for me: JSFiddle
HTML
<input id="phone_numbers" type="textbox"></input>
Javascript
document.getElementById("phone_numbers").readOnly=true;
If the textbox is server side, then use document.getElementById("<%= phone_numbers.ClientId %>") to access it.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
Right so I've got a bit of jQuery that exposes a couple of divs on the right hand side of my page. Here's the test link that works:
TEST
Now when I integrate that into my site it doesn't work at all and I can't find the glitch. I've just copied the entire page from the test into my layout page as, no matter what order I put it in it doesn't work. Can anyone identify the bug? I'm sure I'm doing something wrong that is so simple but need a bit of professional guidance. Here's the non-working link:
SITE
Uncaught TypeError: Object #<Object> has no method 'onEnd'
sublimevideo.ready(function() {
sublimevideo.onEnd(function(sv) {
sublimevideo.stop();
});
});
That is where your error is, .onEnd() is not jQuery.
Syntax error bro :)
Czas: 04.07.2013 14:00:21
Błąd: SyntaxError: syntax error
Plik źródłowy: http://www.quotesin.co.uk/index.php
Wiersz: 76, Kolumna: 51
Kod źródłowy:
jQuery('#userNav').show('slide',,1000);
I opened the SITE link in Firefox with Firebug running and found this syntax error:
jQuery('#userNav').show('slide',,1000);
Firebug is pointing to the second comma after slide on line 84.
Are you using Firebug or some other developer's tool such as the ones available in Chrome or Safari to do your debugging?