0

Sorry if this question is basic one.

When i view Page source in browser for my website, the links in menu bar are not visible in view source option. instead i get this:

   <div class="nav-container">
<div id="custommenu-loading" class="">
    <div class="menu">
        <div class="parentMenu menu0">
            <a href="javascript:;">
                <span>Loading...</span>
            </a>
        </div>
    </div>
    <div class="clearBoth"></div>
</div>
<div id="custommenu" class="" style="display:none;">
    <div class="menu">
        <div class="parentMenu menu0">
            <a href="javascript:;">
                <span>Loading...</span>
            </a>
        </div>
    </div>
    <div class="clearBoth"></div>
</div>

The links are coming from javascript.

the thing which is bothering me is that when i view page source of another site built in magento, i can see all links of that website there as a list.

Will this effect the search engine indexing? Links are not visible in page source then search engines may not crawl all those links?

How do i change it to make all links visible instead of javascript.

Magento version i am using is 1.8.1.0

Thank you.

1 Answers1

0

Viewing the source is not necessarily the same as inspecting the DOM.

To 'View Source' (in some browsers) is to make another web request. You are not viewing the source of what has just been rendered out on your page.

Thus, viewing the source in plain text won't cause any javascript to run. Since you said in your OP that it's javascript which is responsible for the population of the links, I'd imagine this is what you're experiencing.

To confirm whether this is the case or not, right click on the nav-container div on the actual page and click 'Inspect Element'.

  • thanks for replying. so that means that it has nothing to do with search engine crawling? any search engine will easily access all the links even if they are coming from javascript? – khurramsch Nov 05 '14 at 11:31
  • The fact you're seeing no links has nothing to do with search crawling. If what you're asking is whether a search engine would see the links or not - the answer lies within the way each individual search engine works, an attempt at answering this lies here: http://stackoverflow.com/questions/12265273/can-google-crawl-javascript-generated-links –  Nov 05 '14 at 11:38
  • Thanks. Is there any way to just remove javascript from there by editing some files etc? – khurramsch Nov 05 '14 at 12:21
  • Remove javascript from where? –  Nov 10 '14 at 08:55
  • Hi, sorry. i meant is there a way that i can edit some files and remove the javascript from the code block attached in question? And get menu links directly. – khurramsch Nov 10 '14 at 09:37
  • Well this entirely depends on what your javascript is doing. I can't tell you how to remove it, mimic it, or work around it because I don't know anything about it. If what you want to do is simply captured the rendered HTML, right click on the element > inspect element > right click on the node (in chrome developer tools) > copy > paste wherever. –  Nov 10 '14 at 09:53