skibascott
IS-IT--Management
I am using a javascript function to collapse iframes. Here is the function:
The code I am using on one of the iframes, works fine. It is coded with plain html and javascript. Here it is:
Now, the additional iframes that will not collapse are coded in an asp script with the response.write function. Here it is:
I am almost positive that the error is in the syntax of the onclick visibility function call. When I compare the source of the html output, the code for both of the iframes(the functional iframe as well as the non-functional iframe) is identical execept for the onclick function call. The one that works, uses single quotes to encapsulate the entire function and double-quotes around the first parameter of the function call. The iframe that will not collapse has single quotes around the function as well as the first parameter. I believe that is the problem. I just cannot figure out the syntax to correct this. When I try to use the double quotes around the first parameter of the function, I receive an expected end of statement error.
How do I code this function call to use double quotes instead of single?
Code:
function visibility(obj, anchor) {
if (document.getElementById(obj).style.display != "") {
document.getElementById(obj).style.display = "";
anchor.innerHTML = '[-]';
}
else {
document.getElementById(obj).style.display = "none";
anchor.innerHTML = '[+]';
}
}
The code I am using on one of the iframes, works fine. It is coded with plain html and javascript. Here it is:
Code:
<a href='javascript:void(0)' onclick='visibility("psheet", this);'>[+]</a>Process Sheet <%Response.Write SheetNum%>
<IFRAME style="display: none" id="psheet" SRC='file:\\server13a\apps\Process Sheets\tempsheets\<%Response.Write SheetNum & ".pdf"%>' WIDTH=100% HEIGHT=100%>
</IFRAME>
Now, the additional iframes that will not collapse are coded in an asp script with the response.write function. Here it is:
Code:
Response.Write "<a href='javascript:void(0)' onclick='visibility('QA" & x & "', this);'>[+] </a>Quality Alert " & Link & "<br>"
Response.Write "<IFRAME style='display: none' id='QA" & x & "' SRC='file:\\server13a\shared\QUALITY\qalerts\qatest\" & Link & ".htm' WIDTH=100% HEIGHT=100% BACKGROUND-COLOR=BLUE>"
Response.Write "</IFRAME>"
I am almost positive that the error is in the syntax of the onclick visibility function call. When I compare the source of the html output, the code for both of the iframes(the functional iframe as well as the non-functional iframe) is identical execept for the onclick function call. The one that works, uses single quotes to encapsulate the entire function and double-quotes around the first parameter of the function call. The iframe that will not collapse has single quotes around the function as well as the first parameter. I believe that is the problem. I just cannot figure out the syntax to correct this. When I try to use the double quotes around the first parameter of the function, I receive an expected end of statement error.
How do I code this function call to use double quotes instead of single?