Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bootstrap 3 Collapse Menu Does not work
Message
 
 
General information
Forum:
CSS
Category:
Other
Miscellaneous
Thread ID:
01595941
Message ID:
01595996
Views:
25
>>>>>>>>>>>>>You need script references to jquery.js and bootstrap.js. for the animation - if you look in Fiddle jquery is set in the 'Framework and Extensions' section and bootstrap.min.js in 'External Resources'
>>>>>>>>>>>>
>>>>>>>>>>>>I added references to jquery.js and bootstrap.js and still the menu is not working. Do you know if it matters in which order the .js libraries should be in the script? Although I think I tried many different ways. And should .css reference be before or after the .js?
>>>>>>>>>>>>Thank you
>>>>>>>>>>>>UPDATE: I put the .css and .js references in exactly the same order as they appear in the Fiddle but to no avail.
>>>>>>>>>>>
>>>>>>>>>>>I think you may need jquery before the bootstrap.js. I used your HTML with added css/script references as below. Your paths/versions will obviously be different: - adjust as ness (and check that they are loaded in the browser).
>>>>>>>>>>
>>>>>>>>>>I did put the bootstrap.js after the jquery.js. The attached is the image of IE development tools to see if all libraries are loaded. And it looks like they are (correct me if I am wrong). But it looks strange is the jQuery is showing twice. I am confused.
>>>>>>>>>>
>>>>>>>>>>UPDATE. I even downloaded the jQuery 2.1 version, as you have it in your code; just to match it. But to no avail.
>>>>>>>>>>
>>>>>>>>>>I think the problem is with my Bootstrap.css. But I even downloaded the copy from Fiddle and still no go.
>>>>>>>>>>I also tried to run the same code in Chrome and Firefox. The same negative result.
>>>>>>>>>>Next, I will try to run this test code on another computer.
>>>>>>>>>>
>>>>>>>>>>UPDATE2. My Network result in the IE Development Tools looks strange. Does not look anywhere how the results look when I capture them in Fiddle.
>>>>>>>>>
>>>>>>>>>Hmm. Not sure which version of IE/DevTools you have - mine looks completely different. I notice yours shows '0 bytes' whereas mine has a byte count, a 'GET' method and a Result code. Any errors in the DevTools Console tab ?
>>>>>>>>>
>>>>>>>>>Don't know why jquery would load twice unless (a) you have a master page that also loads it or (b) your using a bundle in ASP.NET?
>>>>>>>>
>>>>>>>>The result I showed in my previous message was from running test.html outside of ASP.NET or VS. But I think the fact that you get GET method and I don't could be the key to my problem. I will google for possible solutions.
>>>>>>>>Thank you.
>>>>>>>
>>>>>>>Don't know what else to suggest. Obviously, if you are running the HTML page directly then the paths for the .js and .css will need to be absolute file paths rather than website-relative. Other than that....... :-{
>>>>>>
>>>>>>You have been very helpful. Thank you. I will try this test html on another computer to see if this is something "wrong" with my computer only. I will let you know.
>>>>>
>>>>>Very much doubt it's the box. Did you check the browser console to check whether the downloads were successful ?
>>>>
>>>>You were right. Changing box didn't make the difference. But I found the solution. I had the script src of bootstrap.min.js defined as:
>>>>
>>>><script src="~/content/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
>>>>
>>>>
>>>>I removed the leading '~/' and change the src as:
>>>>
>>>><script src="content/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
>>>>
>>>>
>>>>And now the menu works. Does it mean that using '~' in defining the src is a bad idea in all places?
>>>
>>>The tilde is used on Asp.net server controls and gets translated to the full url which is sent to the browser. (tildes mean nothing to browsers)
>>
>>When use tilde in specifying the src and then - when viewing the rendered page - click on View Source, I see the tilde. I am just trying to see if I should do away with using tilde in my VS 2012 source at all.
>
>If you see the tilde in the browser then you're in trouble - as above, it makes no sense to the browser. *Only* use it for asp.net server controls - asp.net will convert the tilde to the relevant absolute address before sending it to the browser.....

This explains why I had the problem, tilde. I will read and learn how to make sure I don't run into the same problem again. Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform