Application do not render when trying to view using Firefox or Chrome

793
4
05-20-2011 02:15 PM
DonKang
New Contributor III
I am not sure what I am doing wrong but my javascript custom application only works in IE.
And it fails in Firefox and Chrome.
Can anyone see what is going on?

I am building custom application using visual studio 2010 on aspx and cs.

For a test, I've added sample code of "Add Dynamic Map" to my aspx page. This particular test worked on all 3 web browsers.
For a second test, I've added sample code of "Full Map" to another aspx page. This time, map only
shows up in IE and fails on Firefox and Chrome.

Can anyone see what is going on? Do anyone have similar problems?

One difference that I've noticed between my first test and second test is that first test do not really use any of those dojo.dijit stuff...
Where second test uses dojo.dijit stuff in <div> to resize the map based on web browser size...
dojo.require("dijit.dijit"); // optimize: load dijit layer
      dojo.require("dijit.layout.BorderContainer");
      dojo.require("dijit.layout.ContentPane");
Above things are only defined in the second test.

Could dojo possibly creating some problems?

Welcome any comments.

Thanks

Don Kang
0 Kudos
4 Replies
DonKang
New Contributor III
I am still struggling with this issues.

I've created a html page with "Full Map" sample under "Layout".
This sample works fine in all the browsers.
However, if I add <form> tag and wrap it around the map <div>
I get nothing using the firefox or chrome.

<form dojoType="dijit.form.Form" id="form1"> <--- this is the form that I am talking about --->
<div dojotype="dijit.layout.BorderContainer" design="headline" gutters="false"
style="width: 100%; height: 100%; margin: 0;">
<div id="map" dojotype="dijit.layout.ContentPane" region="center">
</div>
</div>
</form>

Anyone encountered my problem and wish to share thoughts?
One interesting pattern that I've noticed is that none of the ESRI samples has <form> tag included.

This is driving me crazy here.
Do I just tell my users not to use Firefox or Chrome??

thanks

Don Kang
0 Kudos
HemingZhu
Occasional Contributor III
I am still struggling with this issues. 

I've created a html page with "Full Map" sample under "Layout". 
This sample works fine in all the browsers. 
However, if I add <form> tag and wrap it around the map <div> 
I get nothing using the firefox or chrome. 

<form dojoType="dijit.form.Form" id="form1"> <--- this is the form that I am talking about --->  
<div dojotype="dijit.layout.BorderContainer" design="headline" gutters="false"  
style="width: 100%; height: 100%; margin: 0;">  
<div id="map" dojotype="dijit.layout.ContentPane" region="center">  
</div>  
</div> 
</form> 

Anyone encountered my problem and wish to share thoughts? 
One interesting pattern that I've noticed is that   none of the ESRI samples has <form> tag included. 

This is driving me crazy here. 
Do I just tell my users not to use Firefox or Chrome?? 

thanks 

Don Kang


if you use dijit.form.Form as your root, you just need style it. something like this:
<form dojoType="dijit.form.Form" id="form1" style="width:100%; height:100%; margin:0px; padding: 0px; border: 0px">
0 Kudos
derekswingley1
Frequent Contributor
Hi Don,

What are you trying to accomplish by putting a map inside a form?
0 Kudos
DonKang
New Contributor III
Heming Zhu
Thanks for your suggestion and you are right, having styles in the form tag made maps to show up in firefox and chrome.
<form id="form1" style="width:100%; height:100%; margin:0px; padding: 0px; border: 0px">
Taking out dojoType from the form seems to behave a lot better on my custom application.
I'll do more testing so to apply aginst my custom application but you've just resolved most of my headaches.

Derek,
I am trying to build a asp.net application, so that I can do some server processing, such as accessing database directly with map present.
Also access or call javascript function from the server side as well. Asp.net forces you to have <form> tag and place server side controls like buttons or dropdownlist inside the form tag.
I guess I can change my design layout, but my custom application require that map to sit insde the form tag.

I am pretty new to the javascript api and no prior experience with dojo stuff.
Seems to me the dojo stuff is something that I need learn more about.

thanks

Don
0 Kudos