PDA

View Full Version : What is the problem when menu populating?



venkat6134
11-30-2010, 12:49 PM
1) Script Title: Flexdropdown

2) Script URL (on DD): www.dynamicdrive.com/flexdropdown

3) Describe problem:
When i mouseover on the hyperlink in my site, the menu items and sub-items are populating from database... it is showing nice in mozilla but in IE at first time when we mouseover on it, it wont display any thing. At second time when we mouseover on it(without refresh page) it will dispaly nice...

What is the problem and how to fix it?

Thanking you...

ddadmin
12-01-2010, 05:14 AM
Please post a link to the page on your site that contains the problematic script so we can check it out.

venkat6134
12-01-2010, 05:54 AM
When i mouseover on the hyperlink 'products','companies' menu in top, in my site, http://rfcables.org, the menu items and sub-items are populating from database... it is showing nice in mozilla but in IE at first time when we mouseover on it, it wont display any thing. At second time when we mouseover on it(without refresh page) it will dispaly nice...

What is the problem and how to fix it?

Thanking you...
__________________

ddadmin
12-01-2010, 01:05 PM
Try giving your page a valid doctype (http://www.javascriptkit.com/howto/doctype.shtml) at the very top, for example:


<!DOCTYPE HTML>

jscheuer1
12-01-2010, 04:11 PM
Try giving your page a valid doctype (http://www.javascriptkit.com/howto/doctype.shtml) at the very top, for example:


<!DOCTYPE HTML>

Yes. However - if that doesn't fix it completely or if there are other problems, look at the rfcables.org page in any browser's 'view source'. You will see that it has at least two each (opening and closing) html, head, and body tags. With the change ddadmin recommends, which might fix it, it will now also have two DOCTYPE tags.

Technically speaking no page is allowed more than one of each of these tags. Many browsers will error correct for this, but some may actually register it as more than one page, which can cause problems.

To fix that, we have to validate the page as it is served, making whatever changes to both it and the include(s) that are required to produce a valid HTML document.

venkat6134
12-02-2010, 05:03 AM
Thank you for your reply...

I used to include one page into another page. Thats why it showing two times <html><head><body> tags.

Can you give me the solution, how to prevent this?

jscheuer1
12-02-2010, 05:57 AM
Well first of all try what ddadmin suggests, use the:


<!DOCTYPE html>

as the very first thing on the rfcables.org page. If that fixes it, fine.

But to answer your other question, it's pretty much as I said it in my last post. If you have any include, it shouldn't have anything on it that doesn't belong where it's going in the finished document.

Validate the page at:

http://validator.w3.org/

You will see lots of violations. Take a few deep breaths, I know it can be very disconcerting at first. But once you arrange things so that the page that's served is valid, you will generally have less problems. And what problems you do have should be easier to address.

venkat6134
12-02-2010, 09:34 AM
After adding the <!DOCTYPE html> , the pages are mostly differ in both IE and Mozilla.
Can you give me the reason? and solution to this problem?

Thanking you...

Beverleyh
12-02-2010, 10:38 AM
As the guys already said, you need to clean up your code and use a valid doctype.

The page that is being included shouldn't have any head or body tags, etc., just the html code. This is so when the pages are served together as a complete page, it only has one set of html, head and body tags, etc., from the main page and just body-worthy html code from your include page.

Try to visualise your include as a fragment rather than a complete web page in its own right - kind of like a piece from the middle of a jigsaw; on its own it doesn't make much sense but once its viewed as part of the whole, the picture (your web page) becomes complete.

On the other hand, in cases where you really need to display a whole web page inside another, you would probably have to resort to use of an iframe.

Anyway, you have your answers from John and ddadmin so now it requires a little more work on your part to cleanup your include page.

venkat6134
12-02-2010, 10:48 AM
Thank you for your reply.

When i use the <!DOCTYPE html> tag, the format of the page is changed in Mozilla and IE.
But after adding this <!DOCTYPE html> tag, If the browser is IE6 and IE7 , that menus are not showing properlly.

Why the format is changed from IE and Mozilla..?

venkat6134
12-02-2010, 11:08 AM
Now you see the site:: http://www.rfcables.org
The format and all contents are changed..

Which type of <!DOCTYPE html > i want to use to overcome this problem...

Please suggest me, its urgent to recover it...

Thanking you....

Beverleyh
12-02-2010, 11:23 AM
At the risk of sounding like a stuck record, you need to clean up your page code.

A doctype works with the code of a web page and gives a web browser instructions to read and display the page a certain way. If the code is ordered well and matches the doctype, the browser reads the web page easily and everything looks nice and works well. This can be likened to a book written in english with "this book is written in English" on the cover - your read the prologue and chapters in order and everything makes sense.

Now, having a badly structured web page with code that doesn't match the doctype is like having a silly book with "this book is written in English"
on the cover, except the prologue comes in the middle, chapter8 is at the beginning, chapters 3 and 5 appear twice and there are Spanish words interspersed with the English and a few german nouns thrown in for good measure.
You would struggle to read the story, and get confused right? That's how web browsers feel about your current web page.

Don't fixate on the doctype at first - concentrate on structuring your web page in a more compliant way with one set of html, head and body tags and css and scripts in the right places.

it might also be useful for you to research a few tutorials in proper use of php includes and even go back to basics by recovering the basic structure of a web page because it currently seems that your having difficulty understanding what each of us is advising you to do.
Its better to do things well and build a web page properly from the start than it is to mash half-understood concepts together and hope for the best.

venkat6134
12-02-2010, 01:10 PM
Is there any other solution for this, not including the <!doctype html> tag ?

After adding this <!doctype html> tag, the format of text alagnment and background-color was changed from IE to Mozilla?

Can you suggest what i will do to rectify it.

Please visit my site once:: http://www.rfcables.org and give me the better solution for better presentation.

Thanking you....

Beverleyh
12-02-2010, 01:23 PM
3 people have already given you the solution - clean up you code so you have a properly structured web page!!!! I dont think you'll get any more help until you do this.

You dont seem to understand the basics of good web page structure - maybe this will help: http://reference.sitepoint.com/html/page-structure

venkat6134
12-03-2010, 09:33 AM
Hi,
I added <!DOCTYPE html> tag for all pages in my site, http://www.rfcables.org...

Now the layout, design, presentation problems are there to each and every browser.

can you give me the valuable suggestion to overcome this problem....

I think this is based on the CSS for each browser.... if the problem in css, give me the supporting code i need to add...

jscheuer1
12-03-2010, 06:10 PM
See:

http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.rfcables.org%2F

Fix those up and we'll talk.