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.
|