2013年12月10日星期二

window.frames usage questions

$ (document). ready (function () {
window.frames [0] document.onclick = function (e) {alert ((index));}.;
});

usage of the above , if written windows.frames [0] or another windows.frames ["frame_id"]
nice ,
I need now is to bring frame_id or serial number into the form of a variable is passed , what way?
now attempts have failed

Thank you
------ Solution ---------------------------------- ----------
then you declare a global variable .
------ Solution ---------------------------------------- ----
you define a variable , the same.
$ (document). ready (function () {
var frameId = "frame_id";
window.frames [frameId] document.onclick = function (e) {alert ((index));}.;
});
------ Solution --------------------------------- -----------

  
function is currently doing similar view word documents in a web page , each page belong to a document, the need to intercept mouse click event to get the mouse click position in the document , one is found not intercepted anyway iframe Click on the message , unless   
window.frames [frameId] document.onclick = function (e) {alert ((index)).;   
The frameId explicit written explicitly for the job or the equivalent   
variables can not.   
My current wording is   
var frameId = "pageFrame" + (index);   
window.frames [frameId] document.onclick = function (e) {alert ((index)).;   
  
"pageFrame" + (index) is the iframe id.   
How to overcome this problem Thank you  

variables can certainly okay !
your js is finished loading the page , the event will bind better.
behind you to rebind events.
------ For reference only -------------------------------------- -


good use ah , frameId ought only to be used in quotation marks , or write the serial number must also write 0,1,2,3 job , help ah

Why not use variables here
------ For reference only ---------------------------- -----------


function is currently doing similar view word documents in a web page , each page belong to a document, the need to intercept mouse click event to get the mouse click position in the document , one is found not intercepted anyway iframe Click on the message , unless
window.frames [frameId] document.onclick = function (e) {alert ((index)).;
The frameId explicit written explicitly for the job or the equivalent
variables can not.
My current wording is
var frameId = "pageFrame" + (index);
window.frames [frameId] document.onclick = function (e) {alert ((index)).;

"pageFrame" + (index) is the iframe id.
How to overcome this problem Thank
------ For reference only -------------------------- -------------


$ (document). ready (function () {
var frameId = "pageFrame" + (index);
alert (frameId);
window.frames [frameId] document.onclick = function (e) {alert ((index));}.;
});

I was probably written like this , every time you load the alert (frameId); are executed in accordance with my intentions , but is unable to perform a mouse click event .
novice, please advise
------ For reference only ------------------------------ ---------
variables can certainly okay !
your js is finished loading the page , the event will bind better.
behind you to rebind events.

know how it happened , because the cause of pre-loaded , I calculated the ratio of the actual ID id earlier , resulting in a problem

did not do something in this regard , a laughing stock

Will withheld , what tools can debug js it is best to use the eclipse plugin inside , thank you

This problem has troubled me for a long time , and hey good shame

没有评论:

发表评论