while using document cookie
<script typ="text/javascript">
document.domain="example.com";
</script>
I got an error.i don’t know the exact problem.
Error: uncaught exception: [Exception… “Illegal document.domain
value” code: “1009” nsresult: “0x805303f1
(NS_ERROR_DOM_BAD_DOCUMENT_DOMAIN)” location: “”]
According to the HTML spec,
document.domainis read-only. However, Firefox allows setting it to a superdomain:https://developer.mozilla.org/en/document.domain
The error you’re getting clearly states that you’re making an illegal domain assignment.
You mention cookies in your question. If you’re trying to set the domain part of a cookie, setting
document.domainhas nothing to do with it. You need to provide a domain parameter as part of the cookie string that you’re assigning:More info here: https://developer.mozilla.org/en/DOM/document.cookie