2

I am using the below code to load the iframe src for the parent iframe. But its not working for me.

  var cur_iframeid = frameElement.id;
  alert(cur_iframeid);//Parent iframe id 
  var value = "activity.aspx?id=Y&cust_id=" + cust_id + "&role_id=" + role +";
  alert(value);
  cur_iframeid.src = value;//Its not working.
3
  • Is the +" at the end of var value line a typo? If not, then you have a syntax error which could be the problem. Commented May 17, 2013 at 9:22
  • No i assign only activity.aspx. But its not working. Commented May 17, 2013 at 9:23
  • Please read my comment again. There is a syntax error and the code should read var value = "activity.aspx?id=Y&cust_id=" + cust_id + "&role_id=" + role; Commented May 17, 2013 at 9:25

2 Answers 2

2

seems you are tring to set the source on the frameelement id..not the frame elements... try either:

frameElement.src = value

or

document.getElementById(cur_iframeid).src = value
Sign up to request clarification or add additional context in comments.

1 Comment

At least then give me a one up on my answer then? :)
1

You are trying to set the source of the frame id. I think you need to set the source of the frame:

frameElement.src = value

1 Comment

Thank you so much. I got the exact result.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.