# Javascript permissions question.

**URL:** <https://boards.straightdope.com/t/javascript-permissions-question/53419>\
**Category:** Factual Questions\
**Created:** [February 6, 2001, 11:56pm UTC](https://boards.straightdope.com/t/javascript-permissions-question/53419 "2001-02-06T23:56:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kyberneticist](https://avatars.discourse-cdn.com/v4/letter/k/dc4da7/32.png) [@Kyberneticist](https://boards.straightdope.com/u/Kyberneticist)\
**Post date:** [February 6, 2001, 11:56pm UTC](https://boards.straightdope.com/t/javascript-permissions-question/53419/1 "2001-02-06T23:56:44Z")

</div>

I had an idea for making marking up text in posts on the board easier. I was going to make a small Javascript frame with all the smilies and UBB code in it in the form of handy buttons and fields and have the rest of the site in the other 90% of the screen as a second frame. People could then view the site, and when it came to post, easily add the formatting they wanted. Hopefully it would reduce the incidence of all bolded posts, n such.

However, while my test scripts work fine with local html, when I try to test it on the SDMB side, I get Javascript errors.  
Can I only modify the values in the other frame if the content is coming from a local href?  
An example of what I mean.  
parent.SDMB.document.postthread.message.value += window.document.testfield.testtext.value;

Works with ./test.html but not with, say, [http://boards.straightdope.com/sdmb/newthread.php?action=newthread&forumid=3](http://boards.straightdope.com/sdmb/newthread.php?action=newthread&forumid=3)

I hope that isn’t the case, Javascript n frames is the only way I can think of doing this without putting too much overhead on my server.

---

<div class="post-metadata">

**Author:** ![TheNerd](https://avatars.discourse-cdn.com/v4/letter/t/858c86/32.png) [@TheNerd](https://boards.straightdope.com/u/TheNerd)\
**Post date:** [February 7, 2001, 4:55am UTC](https://boards.straightdope.com/t/javascript-permissions-question/53419/2 "2001-02-07T04:55:40Z")

</div>

I haven’t tried this myself, but it’s quite possible that javascript in different frames will only be allowed to interact if the frames are from the same site.

On the other hand, there’s bound to be a way to do it, but that way will probably vary depending on which browser you’re using.

---

<div class="post-metadata">

**Author:** ![SmackFu](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@SmackFu](https://boards.straightdope.com/u/SmackFu)\
**Post date:** [February 7, 2001, 6:24am UTC](https://boards.straightdope.com/t/javascript-permissions-question/53419/3 "2001-02-07T06:24:08Z")

</div>

Here is the relevant document: [JavaScript Security in Communicator 4.x](http://developer.netscape.com/docs/manuals/communicator/jssec/contents.htm)

The important part is at the top:

> [@](#):
>
> The same origin policy is quite simple: When loading a document from one origin, a script loaded from a different origin cannot get or set certain predefined properties of certain browser and HTML objects in a window or frame.

One of those properties you cannot get or set is document._formname_, which is what you’re trying to do. Sorry.

---

<div class="post-metadata">

**Author:** ![Kyberneticist](https://avatars.discourse-cdn.com/v4/letter/k/dc4da7/32.png) [@Kyberneticist](https://boards.straightdope.com/u/Kyberneticist)\
**Post date:** [February 7, 2001, 8:01pm UTC](https://boards.straightdope.com/t/javascript-permissions-question/53419/4 "2001-02-07T20:01:34Z")

</div>

That doesn’t really surprise me. ☹  
But I do know that one of the things you can do in Javascript is call functions to request greater priveleges from the browser. Does anyone know of functions to do that, for either IE or Netscape, that would work in this instance?
