What is <span>content</span> == $0 mean in html? [duplicate] - html

This question already has answers here:
What does ==$0 (double equals dollar zero) mean in Chrome Developer Tools?
(5 answers)
Closed 6 years ago.
I found a button in the google cloud front end that uses this syntax and I was just wondering what it is all about... Thanks for the input!
I love design patterns and have been getting more into web development lately so forgive me if this is a really basic question!

That's just the element inspector of your browser. It means in the browser's Javascript console, you can now type $0 and get an object that refers to your currently highlighted element. It's a handy shortcut for directly debugging DOM elements interactively.
It's not HTML, it's not even actually part of the web page, it's not specific to that button, it's not a design pattern.

Related

how to toggle between a multiple English and Arabic in my website? [duplicate]

This question already has answers here:
How to make a Multilanguage website [closed]
(3 answers)
Closed 2 years ago.
I'm a junior front-end developer based in Egypt, so most of what I work on will be in Arabic but I will also need to support English since it is the standard website language used.
I'm looking for a solution to help my clients toggle between multiple languages. Should I build an entire project twice or what is their a better solution to switch languages on a wbeite?
Please keep in mind that I'm still a junior developer with just 2 years of experience.
You can declare the language of websites in the <html> tag, e.g. <html lang="en">. Therefore, you should be able to save your original website/project in one language and then save another copy of your website/project with the other language you'd like to show.
Read more about declaring languages in HTML
If you want to do all of this on one page only, you can use JavaScript to change the page's language using an onclick function. MDN has a good tutorial using onclick here. However, this is more complicated since you'll need to use a dictionary, such as Google's Cloud Translation API.

URL Actions from URL only [duplicate]

This question already has answers here:
How do I add target="_blank" to a link within a specified div?
(7 answers)
Closed 6 years ago.
A quick question regarding URL target actions.
Is there a way to specify the target action of a URL within the URL?
Context: I can't edit the underlying code where links live in this particular instance, but I have full control over the links themselves. I'd like to be able to specify a link target (new tab, new window, same tab, etc) from a URL itself.
If that's possible, awesome!
If that's impossible, darn (and thank you for enlightening me).
There's no reliable way as far as I'm aware (it's a security concern). If you only have control of the URL because you're using some other system (you're not the admin), chances are the link is escaped for javascript. If it isn't:
Some link

How to let robots parse our custom html elements? [duplicate]

This question already has answers here:
How do search engines deal with AngularJS applications?
(15 answers)
Closed 6 years ago.
I have a website containing custom elements (i use angular 2), and google fails to parse them correctly :
It only sees
<my-app></my-app>
It seems that the value of this component is not retrieved at all by google robots.
Is there a best practice / workaround ?
Thanks for your help.
This has been asked a million times. Please refer to this question and this specific page by google.
Times have changed. Today, as long as you're not blocking Googlebot from crawling your JavaScript or CSS files, we are generally able to render and understand your web pages like modern browsers. To reflect this improvement, we recently updated our technical Webmaster Guidelines to recommend against disallowing Googlebot from crawling your site's CSS or JS files.
What you can do is getting the HTML of your rendered page and inserting it into the <my-app></my-app> tags without user information or the like.
This will get replaced anyway after Angular has booted up, this means you can even put something completely different in there.

How can I access a window variable from a chrome extension? [duplicate]

This question already has answers here:
Chrome extension - retrieving global variable from webpage
(5 answers)
Closed 8 years ago.
How can I access a window variable from a chrome extension?
For example, I want my extension to just log window.variable?
Is this at all possible?
You need to inject the script at runtime (as opposed to doing it from the content script).
From the injected script use either messages to pass it to the extension, or (easier) write what you need in a DOM element and read it from the DOM (but changing the dom might break the original page)
In the official samples shows how to inject the script by writting a tag.
I know this is a dup of the pointed gmail question but that question has a title that makes it hard to know its about injected scripts.

How to detect an Operating System [duplicate]

This question already has answers here:
Cross Browser Flash Detection in Javascript
(16 answers)
Closed 9 years ago.
I am in the process of trying to rewrite my website, and I have limited experience in HTML/CSS/Javascript. It is a photography website using galleries. I am wanting to make the default view to be using Flash, but I know that iPad/iPhone etc do not support Flash. I am looking for a way to determine what the OS is so I can direct the iWhatevers (and others if there are any), to a purely HTML site, and the non-iWhatevers to the Flash site.
I presume it would be done in the Heading part of the HTML, but what script would I use to do this?
Thank you in advance...
That sounds like a lot of extra work to create to maintain a Flash and a regular HTML site when a properly done HTML5 site can kill all the browsers with one stone. Consider a CMS like WordPress if you are not comfortable with a lot of coding.
However, if you want to go the route you mentioned, this thread will show you how: Detect if device is iOS