Bug Tracker

Ticket #2254 (new bug)

Opened 7 months ago

problem with ajax url when calling top.function() from iframe

Reported by: kostas Assigned to: anonymous
Type: bug Priority: major
Milestone: 1.2.1 Component: ajax
Version: 1.2.1 Keywords: ajax url iframe top firefox
Cc: Needs: Review

Description

HEllo,

topUrl: http://domainA/a/ iframeUrl: http://domainA/a/b/

We have an iframe inside a page. we set an event to a button inside the iframe. ex. onmouseover: top.xFunction(); (to call a function on the top frame : top.xFunction() ).

the xFunction does an ajax request to the page: 'c.do?x=1'. but the url that $.ajax method prefills to the page is the url of the frame, not the url of the top. So instead of asking for: http://domainA/a/c.do?x=1 it asks for: http://domainA/a/b/c.do?x=1 which is wrong.

In explorer this bug is not present.

(further more in the xFunction we did window.alert(window.location) and brings back http://domainA/a/ (when called as top.xFunction) in both explorer and firefox. which is right.)

code:

==TOP FRAME== functionX(){

var toolTip = $.ajax({ url: "c.do?x=1", async: false, cache: false

}).responseText;

return toolTip;

}

====IFRAME=== the function is called by the iframe like this top.xFunction() which does not return a tooltip because the page that tries to access is the wrong one.

Attachments

2254.zip (56.6 kB) - added by nathanhammond 2 weeks ago.
Test Case

Change History

Changed 2 weeks ago by nathanhammond

Test Case

Note: See TracTickets for help on using tickets.