Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [javascript]

JavaScript is a dialect of the standardized ECMAScript programming language, primarily used for scripting web-pages. Use this tag for questions regarding ECMAScript and its dialects/ implementations: JavaScript, JScript, etc., excluding ActionScript.

Filter by
Sorted by
Tagged with
5
votes
1answer
3k views

How do I stop Google from indexing AJAX calls within Javascript?

We are getting a number of odd results come up on Google EG: http://www.somedomain.com/somepage/AjaxFunction.aspx?stuff=XXX&other=XXX When I looked at "somepage" the ajax function is not ...
0
votes
2answers
28k views

Include header and footer html files into another html file [ERROR]

I'd like to know how to include my header.html and footer.html in the rest of my html files, so if I had to change something in my header or footer, I would have to do it once and not by editing every ...
2
votes
1answer
3k views

Event tracking data not showing up in Google Analytics Real Time View

I haven't done a lot of event tracking before, but I had a good read of how to do it and have implemented it with Universal Analytics, and here is the code used to send to GA: function ...
4
votes
1answer
795 views

Server-side rendering for search engines only (SEO)

I have a heavily JavaScript based web app which I want to make it indexable. I know that google bot and others agents can already see JavaScript, but I don't trust they will capture my content ...
2
votes
0answers
966 views

Auto open fullscreen on another monitor

I have been asked by a local company to build an internal system using asp (as all their databases are msAccess and they are not interested in changing). At the moment they are having to visit two ...
1
vote
1answer
31 views

The easiest way to include javascript code to wordpress site? [closed]

I built a website widget. If customers want to add it to their site, they need to put a small snippet of javascript code to head or any part of html, similar as you insert google analytics code. What ...
1
vote
0answers
669 views

Google PageSpeed says “Eliminate render-blocking JavaScript and CSS in above-the-fold content” [closed]

I own a WordPress site and I am trying to improve my PageSpeed Insights score. The only "Red" item I have says "Eliminate render-blocking JavaScript and CSS in above-the-fold content" Render ...
2
votes
0answers
31 views

Common header and footer in HTML, should I use JavaScript, PHP or other for SEO? [duplicate]

Firstly, I am aware this question is similar to others asked in the paste, however I'm specifically asking about the reliability of SEO in this question (also many of the other questions are outdated)....
0
votes
1answer
17 views

Javascript. Tree of hash char [closed]

I'm newbie in javascript. I'm trying to do a tree of hash ("#") in javascript. The output I would to have is something like: # ## ### #### ##### ###### ####### I know how increment the line with "...
3
votes
1answer
368 views

SEO for importing the page header with JavaScript rather than PHP

My website has the same header/sidebar/footer on every page, so I have been importing them using PHP. To do this I forced all html files to be processed through the apache servers PHP handler via ...
1
vote
1answer
493 views

Will Google index text in inline SVG that was rendered through JavaScript?

As far as I know the Google bot will index text inside of inline SVG, this has been answered already. However I don't know this applies to text that was generated through JavaScript. Here is an ...
2
votes
1answer
634 views

How to protect my files on Heroku

My sendemail.php file is located in the root of my website, is there a way to protect it? Also i want to protect or hide my js folder, so noone can see my code with direct link or via the google ...
3
votes
1answer
322 views

Do ad delivery networks accept ads powered by JavaScript or do you have to integrate directly with each publisher?

I want to deliver a JS ad-unit, one which can interact with the user a bit. Can this be done via an established ad network? The ad-unit is a bit of javascript that will manage a block on the page. ...
1
vote
0answers
37 views

Does google track my javascript part of website without setting virtual pageviews in google analytics? [duplicate]

If I not setting virtual pageviews in google analytics for my javascript part of website e.g. <a href="#" class="slideshow-button clicked">Slideshow</a> <a href="#" class="fullscreen-...
0
votes
1answer
751 views

SEO issues with Elm?

Do search engines, particularly Google, render JavaScript created from transpiled Elm code when crawling? Can they follow links, even internal that modify the existing page?
2
votes
2answers
114 views

Will adding background images using JavaScript improve SEO?

I've read that Google ranks sites that render faster higher than slower ones. Will it be beneficial to add background images using JavaScript in order to get the page "loaded" quicker? I see multiple ...
3
votes
2answers
522 views

Can Googlebot see pagination meta tags created with JavaScript?

I would like to render meta pagination links (<link rel="prev"../> <link rel="next"../>) with JavaScript. As Google Search Console does not show rendered meta data is there any other way ...
2
votes
0answers
28 views

How to improve the Autosuggestion Google Maps

I have seen the following example of the Autosuggestion Google Maps feature https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete?hl=en However, if I put a given ...
1
vote
0answers
30 views

Where i can paste Piwik JS code in magento [closed]

I need to integrate piwik for my site. where i can paste my piwik java-script to my magento. Work-Out :: Copy and paste to SYSTEM->CONFIGURATION->GENERAL->DESIGN->Miscellaneous Scripts-> here But ...
1
vote
1answer
41 views

Where do Google get canonical links of a one-page site?

With my miserable JS knowledge I understand that the page originally has a line like this: and then href parameter is changed via JS. Both SF and Deepcrawl are not able to see that change. Thus, all ...
3
votes
2answers
599 views

Google SERP's not displaying target/current page in breadcrumbs

I've used Google's example JSON-LD markup to display breadcrumbs in the search results (https://developers.google.com/search/docs/data-types/breadcrumbs). Google shows breadcrumbs in the search ...
1
vote
0answers
664 views

Why wouldn't Google be able to read AJAX generated JSON-LD schema.org markup parsed from a Google sheet?

There's a lot going on in that question so here's a breakdown: Every Google sheet has a JSON version that can be parsed (example). I've parsed that data using pure JS and AJAX, and generated schema....
3
votes
3answers
103 views

Is animating in Navbar a good idea? [closed]

I am animating in my Navbar with GSAP when the page loads. The navbar is being animated in by changing the height from 0 to 100%. The height in css is always set to 0 and it worries me if the ...
1
vote
1answer
129 views

Noncrawlable Javascript Pagination Issue

We have just completed a revamp of a website with a new design and I had noticed something when running the sitemap generator for the new site. The new site uses javascript pagination which fits the ...
2
votes
1answer
245 views

“wiki is currently unable to handle this request” after installing SimpleMathJax on MediaWiki

I need to show mathematical terms in mediawiki-1.26.2 so I tried to install SimpleMathJax on mediawiki. I followed the described in extension page: I downloaded SimpleMathJax-master.zip then extract, ...
1
vote
1answer
78 views

Allow Googlebot to crawl dynamically generated product pages

I have been doing some reading into how Googlebot crawls javascript generated webpages but am still a little confused on it. Say I have a web page for company XYZ Inc that has 5 general products like ...
1
vote
1answer
356 views

Generate Virtual Pageview via .js OnClick event in Google Analytics

I have some expanding sections (via .js) and I want to see when the user clicks those. So, in the OnClick event I want to attach some .js to fire off a virtual pageview. (I know how to fire an Event ...
0
votes
1answer
74 views

exchange value between two dropdown boxes html [closed]

I'm building a dictionary web. Like every dictionary app, we choose two languages from two drop down boxes. And if we click the "<->" button, two chosen languages will exchange side. For example, ...
1
vote
1answer
80 views

Why everyone uses unsafe content security policy?

I see that all big websites like Google or Facebook, even my bank uses content-security-policy header with unsafe-eval and unsafe-inline. Is there point in using csp if such big companies disable it? ...
4
votes
1answer
841 views

Are Googlebot and other search engine crawlers able to detect if element is hidden after page load by JavaScript?

So, we all know Google hates hidden elements, and rightly so. But I am curious, what if the element is present in DOM normally in the static form, but after page load, it is hidden by JavaScript? ...
1
vote
0answers
37 views

SEO Impact of Javascript for typography (like kerning.js, lining.js & co)

From the design perspective the typography options presented by css are somewhat limited and there exist many javascript libaries that give us very handy tools to manipulate the font-rendering. ...
6
votes
1answer
135 views

Would could Google not index an AJAX news feed after 1 month?

I have a website that in page1.php uses a news API from other website. It has JS calling a PHP method like this: <script id="mdval" src="http://example.com/parvazproject/parvaz.php?c=...
3
votes
1answer
2k views

Is it SEO compatible to set the page title with JavaScript at load time?

I want to change some page elements with JS like title h1,h2,h3, p tags and so on. So I want to place in my code something like $(function() { document.title = "This is the new page title." });...
1
vote
2answers
682 views

How to find out javascript functions for above the fold?

There are plenty of tools to get css rules for above the fold (critical css path), like this one. But how could one find out, which javascript functions are needed for above the fold area? The ...
2
votes
1answer
2k views

Does Google perform onClick actions?

Can somebody approve to see, that Google (googlebot / crawler) performs onClick (or similar js) actions? It is fact, that Google performs POST - i'm interesting, whether somebody has realized any js ...
0
votes
1answer
38 views

seo implication of taking user to some other link rather than href given on anchor through javascript

I have the following URLs on a page: <a class="mylink" href="http://www.example.com/old-product1" /> <a class="mylink" href="http://www.example.com/old-product2" /> <a class="mylink" ...
2
votes
1answer
62 views

Fetch as Google huge margin on top and bottom [closed]

My website has recently started dropping in Google rankings so I started checking out Webmaster Tools. Weird thing is when I used Fetch as Google with render, I noticed huge margins on the top and ...
2
votes
2answers
587 views

Should I dynamically change title/alt of image for SEO?

I use Angular in my application, where I have ng-repeat directive on images (which means, that in my HTML I have only one img tag for all image objects that I receive from server). Should I also ...
1
vote
0answers
314 views

How to create newsfeed [closed]

I have been working on a project of making a website, and I would like to incorporate a newsfeed (similar to Twitter/fb) where all of my users can see other users updates. I have my login and ...
1
vote
2answers
1k views

Block inline scripts from executing?

I need to test a page with no scripts running/executing. I've tried NoScript and uBlock but they seem to only stop externally linked scripts from being executed, not those in ... tags. Any ...
0
votes
3answers
50 views

The webpage is in JS but still text browsers are reading the content. How is it? [closed]

I was checking the site giftedandtalented.com. first of all the the source code is so cluttered. When i disabled the JS in my browser, except for top navigation nothing showed up but when i checked ...
4
votes
2answers
645 views

Workaround for appearing to change the URL of an infinite scrolling page when pushState is not available due to analytics

I'm building a website and they want it to be an infinite scroll single page design, and to be as SEO friendly as possible. Just to give you an example: Here is an example URL structure: com ...
2
votes
1answer
214 views

How to tell if an incoming connection is a cellular network or not

I've got a page that will be loading a bunch of fairly high resolution images, as well as a full HD video. Is there a way to detect if someone is using cellular on their phone vs wifi, so I can use a ...
3
votes
3answers
945 views

Embed Google Analytics Reports On Website

I want to embed Google Analytics charts into my website so that from the admin console I can view certain analytics charts without needing to log into the Analytics console. I have come across the ...
1
vote
1answer
462 views

Google Tag Manager and Data Layer under the hood

I am really newbie in all this marketing stuff, so I understand everything much better on the software layer. Phrases like : "Add this script to your page directly after body tag and it will work" ...
6
votes
1answer
13k views

restricting Google Maps js API keys to just my domain

My site uses the Google Maps javascript API, so I'm using a "Browser key", which is plainly visible in my javascript to anyone who does "View Source". Google's documentation on Browser keys in ...
3
votes
3answers
1k views

Lazy loading images (with data URI) and effects on SEO

I've seen this question: Lazy loading images and effects on SEO My question is very similar, except that I am using data-uri images like so: <img width="1100" height="340" class="img-responsive ...
1
vote
1answer
602 views

Is noscript mandatory for worldwide compliance page compliance?

I tested a random page of mine with javascript on achecker.ca four times: once using the "Stanca Act" guideline in the scanning options, once using the "Section 508" guideline, once using the "WCAG 1....
3
votes
1answer
110 views

Can I randomly change the page title for users while showing search engines a static title?

Let's say I wanted to make a website or series of pages where the title (or at least what appears on your browser's tab) alternates randomly each time it's loaded - just for giggles. I have a bank of ...
0
votes
2answers
58 views

Discrepancy beween Google Analytics and Adword Data

We are facing an issue with data discrepancy between what is reported by adwords and analytics console of google. Wanted to check if someone else has faced a similar issue and what could be potential ...