Side navigation
#11276 closed bug (invalid)
Opened February 03, 2012 03:34PM UTC
Closed February 18, 2012 08:15AM UTC
Javascript loses context after .css() call
Reported by: | ricardoespsanto@gmail.com | Owned by: | ricardoespsanto@gmail.com |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.7.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
call this function:
function channelUserInput() { $("body").append("<div id='screen'></div>"); $("#screen").css({ 'display' : 'block', opacity : 0.7, 'width' : $(document).width(), 'height' : $(document).height() }); //This is the problematic line! $("body").css({ 'overflow' : 'hidden' }); }
from otherFunction (see below) and if otherFunction receives as a parameter an object (in this case a Java object from an applet code) it will lose context and with it all knowledge of that parameter but not of other primitive type parameters :p
so:
function otherFunction(myObject, aString) { myObject.something(); // works channelUserInput(); // works myObject.something(); // FAILS //javascript just lost reference to myObject but not to aString }
Attachments (0)
Change History (2)
Changed February 03, 2012 03:37PM UTC by comment:1
owner: | → ricardoespsanto@gmail.com |
---|---|
status: | new → pending |
Changed February 18, 2012 08:15AM UTC by comment:2
resolution: | → invalid |
---|---|
status: | pending → closed |
Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!
Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket!
Additionally, be sure to test against the "jQuery (edge)" version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/
Open the link and click to "Fork" (in the top menu) to begin.