0

I'm new to javascript and can't change my code to what I wanted.

<iframe name="hidden_iframe" id="hidden_iframe"
style="display:none;" onload="if(submitted)
{window.location='http://site.html';}"></iframe>

My intention is use this window.location (redirecting to other page) to start an action in the same page. If it was a link, my code would be:

<a onClick="OpenSel(1)"></a>

How can I use OpenSel(1) after the onload event?

Thanks!!

1 Answer 1

1

Just stick it after what's already in there:

onload="if (submitted) {window.location='http://site.html';} OpenSel(1)"

Although it's probably easier if you stick this all in a function:

function loadCheck() {
    if (submitted) {
        window.location='http://site.html';
    } 
    OpenSel(1)
}

onload="loadCheck()"
Sign up to request clarification or add additional context in comments.

1 Comment

Oh, God. THANK YOU tymeJV!! Just what I wanted!

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.