Does javascript allow the following?

N

Neelesh

Hi All,

I wanted to know whether any of the following is possible using
Javascript and/or Ajax :

1. Creating new frames at runtime (may be using document.createElement
or existingFrame.cloneNode() or anything else). I tried this but was
not successful (It gave some runtime exception)

2. I want to do a file upload via a POST request. However, in my case,
the server doesnot generate any response - it simply returns a unique
identifier for the file. (It is a php code which does an "echo
$identifier" ). So instead of opening a new page on doing the form
submit, I want to populate some <span> node's innerHTML with that
response.

3. File upload using ajax.

Thanks for your help
-Neelesh
 
T

Thomas 'PointedEars' Lahn

Neelesh said:
I wanted to know whether any of the following is possible using
Javascript and/or Ajax :

1. Creating new frames at runtime (may be using document.createElement
or existingFrame.cloneNode() or anything else).
Possible.

I tried this but was not successful (It gave some runtime exception)

WFM. http://www.jibbering.com/faq/faq_notes/clj_posts.html#ps1DontWork
2. I want to do a file upload via a POST request. However, in my case,
the server doesnot generate any response - it simply returns a unique
identifier for the file. (It is a php code which does an "echo
$identifier" ). So instead of opening a new page on doing the form
submit, I want to populate some <span> node's innerHTML with that
response.

Possible, however .textContent or .firstChild.nodeValue would probably be
better.
3. File upload using ajax.

You can use client-side DOM scripting to generate a `form' element and a
hidden `iframe' element, and then submit that form with the `iframe' as
target. "ajax" only comes into play then when you want to process feedback
from the server about the upload status. (I have been working on a
commercial application that facilitates image uploads without document
reload this way.)


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top