cancel
Showing results for 
Search instead for 
Did you mean: 

Ajax and Illuminator and StyleSheets (XSL)

Former Member
0 Kudos

Hi all, V12.0

I have an AJAX call to this url:

var runnerUrl = 'http://myhostname:50000/XMII/Illuminator'

+ '?QueryTemplate=APEX/Queries/EX/plantSelectionQuery'

+ '&Content-Type=text/xml'

+ '&StyleSheet=http://localhost:50000/XMII/CM/APEX/styleSheets/plantSelection.xsl';

It works, but I get the XML header: <?xml version="1.0" encoding="UTF-8"?> in the

request.responseText which doesn't display when setting innerHTML in a div, so it is OK.

I don't like to do things that are not quite right though.

1. I am wondering what the right way is to have two divs on the page and when a selection is

done from the list(a link tag with javascript href) in the first div, send in a request to retrieve the

data and populate a list into the second div. And it needs to be rendered in a special way

(sort of like a horizontal nav bar), so I don't want to use packaged XMII widgets.

2. Also I would like to use a relative URL like XMII/Illuminator?etc. Or maybe get the

hostname and port from somewhere? http://localhost:50000. gives js "access denied" and

XMII/Illuminator... results in 404.

Thanks,

--Amy Smith

--Haworth

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You can add

<xsl:output omit-xml-declaration="yes"></xsl:output>

in your xsl to remove the header.

1. I don't think there is a "right" way. You may want to give some indication to the user that the page is waiting for a response.

2.

window.location.hostname

&

window.location.port

Also you need to add

Session=true

to the url to pass security.

Former Member
0 Kudos

Thanks Chris. You really deserve 30 points because that was 2 answers and an important tip!

Answers (2)

Answers (2)

Former Member
0 Kudos

If you use /XMII/Illuminator (note the initial / character) it should work just fine using relative links, as long as you are loading/testing your pages via the server and not just loading them from disk.

Former Member
0 Kudos

Just as an FYI, for the most reliable/cross-browser usage, you should URL encode the "right side" of any URL parameters when you build up your URL string. In particular, the string "http://localhost:50000/XMII/CM/APEX/styleSheets/plantSelection" should be URL encoded so that the special characters such as : and / are properly interpreted.