Jump to content

Recommended Posts

Generally speaking, I have a love/hate relationship with Javascript. That said, I am trying to clean up my website for a new job and would like to demonstrate that I can use JS without giving up functionality.

 

I have a page that demonstrates the websites in my portfolio. There are submenus under the main navigation. When you are on the webs page, switching between submenu items is done with Javascript. I would like to make that content available to users with JS disabled. I had the bright idea to stick it inside the <noscript> tags, but that stretches out my page container with invisible content even if you are using JS.

 

Has anyone gone through this before? Does anyone have any thoughts about how to make this content available for JS disabled users without removing the Javascript?

 

Thanks in advance!

Edited by nodirtyrockstar

You could create an alternate page set and link to it within the noscript tags with something like "It seems you do not have Javascript enabled in your browser - please click here to view the javascript free version of my work"

 

then copy paste and tweek to suit.

You could create an alternate page set and link to it within the noscript tags with something like "It seems you do not have Javascript enabled in your browser - please click here to view the javascript free version of my work"

 

then copy paste and tweek to suit.

 

That isn't going to help with the page layout.

 

When using Javascript you should always first make the page function and display properly without any JS code. Once this is done the Javascript can then be added to manipulate the DOM elements. For instance, if I have a navigation bar with a link on that I want to open a sub menu when a user moves their mouse over it, I would make the sub menu hidden to the user using CSS (display:none;). If Javascript is disabled then they can only click on the link in the navigation that will take them to a page containing further links that would normally have been displayed in the sub menu. With Javascript enabled the sub menu is displayed using the onmouseover action.

Edited by neil.johnson

@Muddy Funster, I think you're right. The functionality is already there to do it without JS (load the pages with a $_GET request). I'll just drop the links in the <noscript> area. Since there aren't many, it won't look suspicious to have a little gap before the footer.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.