Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > AJAXing newbeee question. POSSIBLE or IMPOSSIBLE ?

Reply
Thread Tools

AJAXing newbeee question. POSSIBLE or IMPOSSIBLE ?

 
 
Mel
Guest
Posts: n/a
 
      06-22-2006
Is there a way of restricting operations such as links, buttons etc. to
within the <DIV> only ?

Let me clarify the problem a little.

I am doing an AJAX like operation inside a DIV. I do a server trip
without refreshing the page and get new HTML code that includes links
forms etc back from server. I need to confine operations within this
DIV without refreshing the whole page without using IFRAME.

Am i asking the right question or is there a known solution to such
problems


thanks for your help

 
Reply With Quote
 
 
 
 
Dag Sunde
Guest
Posts: n/a
 
      06-22-2006
Mel wrote:
> Is there a way of restricting operations such as links, buttons etc.
> to within the <DIV> only ?
>
> Let me clarify the problem a little.
>
> I am doing an AJAX like operation inside a DIV. I do a server trip
> without refreshing the page and get new HTML code that includes links
> forms etc back from server. I need to confine operations within this
> DIV without refreshing the whole page without using IFRAME.
>
> Am i asking the right question or is there a known solution to such
> problems
>

Your question is a little bit confusing...

Are you asking if it is possible to use your AJAX response-data
to update only the content of a specific div element, and not the
whole page?

If so, the answer is yes.

If your AJAX call ie. return some html-fragment, and you want a
specific div element to be updated to show this, do something like this

<div id="updateDiv">
....
</div>

....

function ajaxResponse() {
....

var updtDiv = document.getElementById("updateDiv");
updtDiv .innerHTML = xmlHttpObj.responseText;
....
}

--
Dag.


 
Reply With Quote
 
 
 
 
Mel
Guest
Posts: n/a
 
      06-22-2006

Dag Sunde wrote:
> Mel wrote:
> > Is there a way of restricting operations such as links, buttons etc.
> > to within the <DIV> only ?
> >
> > Let me clarify the problem a little.
> >
> > I am doing an AJAX like operation inside a DIV. I do a server trip
> > without refreshing the page and get new HTML code that includes links
> > forms etc back from server. I need to confine operations within this
> > DIV without refreshing the whole page without using IFRAME.
> >
> > Am i asking the right question or is there a known solution to such
> > problems
> >

> Your question is a little bit confusing...
>
> Are you asking if it is possible to use your AJAX response-data
> to update only the content of a specific div element, and not the
> whole page?
>
> If so, the answer is yes.
>
> If your AJAX call ie. return some html-fragment, and you want a
> specific div element to be updated to show this, do something like this
>
> <div id="updateDiv">
> ...
> </div>
>
> ...
>
> function ajaxResponse() {
> ...
>
> var updtDiv = document.getElementById("updateDiv");
> updtDiv .innerHTML = xmlHttpObj.responseText;
> ...
> }



Well Yes and NO !

I have already displayed the result of my server response in the DIV
(which i think is what you showed me). The question is, if the returned
HTML within this DIV has links and the user clicks on them, can i
display the result within this DIV itself and not a refresh on the
whole page ?


>
> --
> Dag.


 
Reply With Quote
 
Ian Skinner
Guest
Posts: n/a
 
      06-22-2006
Mel wrote:
> Dag Sunde wrote:
>> Mel wrote:
>>> Is there a way of restricting operations such as links, buttons etc.
>>> to within the <DIV> only ?
>>>
>>> Let me clarify the problem a little.
>>>
>>> I am doing an AJAX like operation inside a DIV. I do a server trip
>>> without refreshing the page and get new HTML code that includes links
>>> forms etc back from server. I need to confine operations within this
>>> DIV without refreshing the whole page without using IFRAME.
>>>
>>> Am i asking the right question or is there a known solution to such
>>> problems
>>>

>> Your question is a little bit confusing...
>>
>> Are you asking if it is possible to use your AJAX response-data
>> to update only the content of a specific div element, and not the
>> whole page?
>>
>> If so, the answer is yes.
>>
>> If your AJAX call ie. return some html-fragment, and you want a
>> specific div element to be updated to show this, do something like this
>>
>> <div id="updateDiv">
>> ...
>> </div>
>>
>> ...
>>
>> function ajaxResponse() {
>> ...
>>
>> var updtDiv = document.getElementById("updateDiv");
>> updtDiv .innerHTML = xmlHttpObj.responseText;
>> ...
>> }

>
>
> Well Yes and NO !
>
> I have already displayed the result of my server response in the DIV
> (which i think is what you showed me). The question is, if the returned
> HTML within this DIV has links and the user clicks on them, can i
> display the result within this DIV itself and not a refresh on the
> whole page ?
>
>
>> --
>> Dag.

>


Yes, you can, but not automatically or simply. You would have to do
something that would modify the link action|event|behavior so that you
can capture it and control it to get the results and display back to the
div. Not a simple task if you ask me.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
impossible to delete file because it is impossible to take ownership Devvie Nuis Computer Support 21 04-20-2009 02:07 AM
Making the simple impossible and the impossible unthinkable... xfx.publishing@gmail.com Perl Misc 5 06-30-2006 11:50 AM
WIN XPsp2 - WIN 98se wireless network file sharing impossible =?Utf-8?B?WW91dmVz?= Wireless Networking 1 01-18-2005 09:40 PM
newbeee Nathan ASP General 5 12-30-2003 06:16 PM
Re: VPN (after Tunnel) connection impossible zak Cisco 0 10-10-2003 08:40 AM



Advertisments