You are using JS so any one can look at the source and see what you are doing.
All frames are bad, avoid using if you can. If you have to only then use an iframe. Being said that, in your case you can use ajax without any problem. I have tested above your example and my div got populated just fine.
I personally use this to pull the dynamic content created by the processing page. My code is on load and at that time the divs are hidden. I show these after these get populated. Tested these with a click and work great.
Regarding ASP part, in the get i am passing a paramter to the page that i want to pull in the information from. You can change .asp to .php.
var custIdentifier = ‘<%=customerIdentifier%>’;
This is just getting the customer identifier from server side to the client side and then use it. You can replace this with PHP equivalent ‘<%=customerIdentifier%>’.
Are you pulling in the information from local file or another website? If it is another website then you’ll need to use iframe.
Do you use FireBug to actually see what is happening when you click the link? It will tell you exactally if there is some thing wrong with your JS or with other page, even if it has server side code error.
As you said all frames are bad. yeah you are right because anyone can see what we have put it into it. So which is best way to refresh only div on the particular page?
BTW, for time being i am solved with my problem. But really want to know if there is any other method is there to refresh only div or not?
I try to avoid frames as much as i can. With JQuery livequery plugin and JQuery live selector this has even become more easy as we can apply click, blur and change events very easily to the content being pulled and shown in the div rather than iframe.
My above code is a working code, my page shows content from 4 different products. On load i show classic ajax animated image (circular moving image) and then as content gets pulled and then put in the particular div, before making it visible i hide the animated image.
Try downloading firebug for firefox and before clicking your link, make it visible. You’ll see what is happening and will also see exact error that happened.