0

I'm currently writing a widget that anyone can put on their website.

Currently, when clicking on a button, an iFrame opens with a long url (with encrypted data). But, if the amount of data to be encrypted gets to much, there might be an issue since in IE8 the URL length can only be 2k.

What I want to do (without jQuery) is to POST this data to the iFrame instead of using GET.

I've seen the method of creating a hidden form, with target="iframename", but this isn't really helpful since I don't want to be creating forms on another website which isn't mine.

Is there another solution to POST to an iFrame without having to generate a form.

Targetet browsers are IE8+ (and chrome/ff/safari etc). IE7&6 are not supported by our widget.

2
  • It sounds like you have some code now that uses get? If so, it would help if you posted it. Commented Dec 13, 2012 at 15:08
  • Actualy, <form> is the only way you can do that. Commented Dec 13, 2012 at 15:15

1 Answer 1

2

I've seen the method of creating a hidden form, with target="iframename", but this isn't really helpful since I don't want to be creating forms on another website which isn't mine.

That is actually no problem, you can use Javascript to write to your iFrame, and thus you can create the form on your side, then .submit() the form inside the iframe to get your site in question.

Check out Write elements into a child iframe using Javascript or jQuery

Sign up to request clarification or add additional context in comments.

Comments

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.