No JavaScript in dijit.Dialog

1709
9
12-20-2010 12:02 AM
MarcelKleinmann
New Contributor
Hello,

I'm using dojo 1.4.2 in ArcGIS JS API 2.0.

The JavaScript code is not being executed in my dijit.Dialog. In the main html page though, JS and dojo is doing fine. This problem is only in IE8.

IN FIREFOX JS IS EXECUTING FINE.

IN InternetExplorer 8 THERE IS NO JS FUNCTIONALITY IN THE DIALOG!

I've looked the problem up and found a hint, suggesting to use the dojox.widget.Dialog instead of dijit.dialog.
THIS DOESN'T FIX THE PROBLEM.

I need some help please.
0 Kudos
9 Replies
derekswingley1
Frequent Contributor
Post your code so we can see exactly what's happening?
0 Kudos
MarcelKleinmann
New Contributor
Here the important JavaScript declarations:

<script type="text/javascript">djConfig = { parseOnLoad:true }</script>
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.0"></script>
<script type="text/javascript" src="http://o.aolcdn.com/dojo/1.4.2/dojo/dojo.xd.js"></script>


Here the logical JavaScript part:

function opendialog(){
  var cont = "hello world<br><p style='text-align:center'>"+
"<button type='button' value='close' onclick='dijit.byId(\"dialogHint\").hide();'>OK</button></p>";
  dijit.byId('dialogHint').setContent(cont);
  dijit.byId('dialogHint').show();
  }


Here the HTML part:

<button type="button" value="open" onclick="opendialog();">open dialog</button>


I built an example, using the following Esri code, see here.
My example is accessable here.

When you press the "open dialog" button, the opening dialog contains an "OK" button. This one closes the dialog. In Firefox it's doing fine, in IE8 it's not.

Though, not only this dialog window is making me trouble, but all JavaScript code I try to perform in an dijit.Dialog.

Can anyone help please?
0 Kudos
AxelSchaefer
New Contributor II
Change the CSS link of the claro.css to the according version of the JS-API (2.1)

@import "http://serverapi.arcgisonline.com/jsapi/arcgis/2.1/js/dojo/dijit/themes/claro/claro.css";


Why do you use the external dojo link?

<script type="text/javascript" src="http://o.aolcdn.com/dojo/1.4.2/dojo/dojo.xd.js"></script>


Best regards,
Axel
0 Kudos
MarcelKleinmann
New Contributor
Hi Axel,

true, versions of CSS and API were not same, so I changed versions accordingly. I couldn't find a claro.css 2.0, so I changed the API to 2.1 instead to have both in 2.1.

I used the external dojo link just to try if this can be the problem. Now I disabled this code.

Unfortunately this doesn't change anything in my IE8 browser. I still can't close the 'hello world' dialog by pressing 'OK'. I assume an IE settings problem of my local installation. Only, in the settings I'm not allowed to change too much as a default user. I added all the references to 'trusted sites' to avoid a JS disabling.

I'm in contact with esri support meanwhile. So I hope we can sort it out this way.

Cheers
Marcel
0 Kudos
JacobBrozenick
New Contributor II
In the example link you gave the "ok" button seems to work in IE8 ....

is it supposed to?
0 Kudos
MarcelKleinmann
New Contributor
Hi Jacob,

ok, thank you for your reply! No, in my IE8 the 'OK' button is not doing.

So it must be a local IE8 configuration problem. I'm just checking this.

Cheers
Marcel
0 Kudos
MarcelKleinmann
New Contributor
Yes, it was a local configuration problem.

When the administrators upgraded the IE6 to 8 recently, there was a mistake in the configuration of the group user settings.

Now it's doing!

Cheers
Marcel

and MERRY XMAS to ALL !
0 Kudos
JacobBrozenick
New Contributor II
good to hear 😄

and merry Christmas to you too!
0 Kudos
shamabanu
New Contributor
hey i got one problem

i want to hide the dialog on the cancel of 'X' mark,how to do it in java script
0 Kudos