Explain the same-origin policy with regards to JavaScript?

Explain the same-origin policy with regards to JavaScript?

The same-origin policy restricts how a document or script loaded from one origin can interact with a resource from another origin. Same-origin Policy is used as a means to prevent some of the Cross-site Request Forgery attacks.

The “origin” is the same if three things are the same: the protocol (http vs. https), the domain (subdomain.yoursite.com vs. yoursite.com vs. google.com), and the port (: 80 vs.: 4567). Using JS, we would be able to fetch resources (typically data like text,html,json,etc) using JSONP where we create a script tag dynamically with src attr pointing to the end source. Insert the script tag into the head section of the page. This will force the browser to fetch the end source similar to how it fetches any other JS or image via http.

PARALLAX SCROLLING WEBSITES AND SEO

PARALLAX SCROLLING WEBSITES AND SEO

Originally created for the gaming industry, parallax scrolling is basically a scrolling technique in computer graphics, where a background image moves in along with a foreground images, but at a slower rate. This kind of “special effects” technique creates an illusion of depth for a website.

Parallax scrolling is a pretty complicated design technique and you might want to keep the below mentioned points in mind.

  • Start with creating an SEO architecture, eventually moving on to implementation of your design.
  • Parallax Scrolling is really unsuitable for mobile websites or their mobile-friendly versions because it makes websites noticeably heavy. So, if your main site runs parallax scrolling, it is best to remove it from your mobile website since it will in invoke a tedious user-experience.

As a web developer, one should be aware that parallax scrolling can cause multiple SEO issues because it adds a lot of weight to a website, and no search engine wants to deal with a content heavy website, including Google. Again, it is recommended that one ascertain as to whether they really want or need parallax scrolling effects on their website.

This is because people are averse to change, and if you have a website that has been running for a long time and has high-traffic inflow, it’s best to keep track on how the users or visitors are reacting to the changes on the website.

Does Parallax Really Affect SEO?

To put all your doubts to rest, yes. If not implemented properly, parallax scrolling can seriously affect your SEO rankings. It is common knowledge that search engines search for and identify websites that are rich in content and functionality.

Coincidentally, search engines also loathe heavy website, putting web developers in a really tight spot. It is, however, useful to note that a parallax-enabled website is typically just a single or one-page website. You also know that you aren’t allowed to have multiple H1 headers or meta-descriptions for a website that has all of its content crammed into a single page, no matter how convenient it is for you.

Challenges of Parallax Scrolling:

So, let’s see what parallax scrolling actually does for your SEO intentions.

Parallax Design For SEO

1). Loading Time

Parallax-enabled websites have much longer load times than standard websites. And nothing is more annoying than a website that takes forever to load. In fact, statistics have revealed that users will switch websites if the load time exceeds 5 seconds, five seconds! Which means you only have 5 seconds to retain the interest of a potential customer.

2). Measuring User Engagement

For a website that employs parallax scrolling, it is very difficult and in some cases, virtually impossible, to measure the level of user engagement using Google Analytics. This is because Google Analytics employs a JavaScript tracking code, which it uses to obtain user engagement calculations. Plus, it is impossible to figure out where most of the user traffic is headed, on a site that hosts just a single page.

3. Not Always Browser-Friendly

It might be possible that a parallax page does not work properly across all Web browsers. A page can run properly in Firefox but fail to do so in Google Chrome. The same can happen in the case of Internet Explorer and Safari. It might require extensive testing to make sure that everything works accurately across all web browsers.

4. Not Mobile or SEO-Friendly

The biggest risk of running a parallax site may be its inability to run properly on mobile web devices. And with the ever-increasing popularity of mobile smartphones and tablets, non-mobile user friendly websites will definitely be a burden on their business. Another peculiar issue with enabling parallax scrolling is the difficulty for developers to optimize the site for specific keywords. This is because it is difficult to optimize for multiple keywords on a single page of web content, compared to that of a multiple-page website.

5. How to handle Parallax Scrolling and SEO?

Irrespective of how complicated a technique parallax scrolling may be, if you really want the parallax effect on your site, there are a few structural ideas that you can use to run your website with parallax scrolling while also keeping it search engine optimized.

A solid start would be to assign all internal links to different sections of the parallax website, which would really help the search engines index page content.

Another point you should consider is that these navigation functions can also be used for internal linking at the same time. This ensures seamless accessibility to the webpage, allows you to use the parallax effect, and use multiple pages simultaneously. By doing this, you will effectively have multiple URLs while also performing keyword-
specific optimization on them. It’s recommended that you use tools like Ajax and the navigation functions to change the URL. This will improve the user experience since they will be automatically redirected down to the webpage to the relevant post with a special URL.

Finally, try starting your own blog and keep updating it frequently. This will not only impress your guests by keeping the parallax effect running smooth on your site, but the blog you just created will also increase the flow of traffic to your site.

What’s this Typescript all About?

What’s this Typescript all About?

If you’re a Java programmer, you’ve probably heard of Typescript. But, what exactly is TypeScript?

Most web JavaScript developers will tell you that it’s a programming language that is strictly a superset of JavaScript. It provides JavaScript users with the added advantage of optional static typing and class-based object-oriented programming.

It is basically a compiled version of native JavaScript that runs without the support of a dedicated runtime library. It is designed and developed by Microsoft.

Overview

With the introduction of an optional typing system, TypeScript attempts to incorporate the advantages of a statically typed language into the dynamic world of JavaScript. Some of these benefits will include:

Type Script

  1. Accuracy with Type Checkers: Getting a platform that makes it easier for developers to create an accurate and predictable code that will eliminate common errors such as typos or incorrect value-type assumptions. Such errors are detected during the compile stage by type checkers.
  2. Seamless IDE Integration: With the information of types, an IDE can become more productive by providing useful features such auto-complete. It is open source, but you only get the clever Intellisense as you type if you use Microsoft’s Visual Studio.
  3. It is now possible to perform code refactoring operations like renaming functions or variables automatically and safely.

TypeScript vs JavaScript
Type Script is JavaScript with high level language features

TypeScript vs JavaScript
Classes

In relation to its structuring mechanism, TypeScript introduces the concept of a class-based object-oriented programming, making it much easier to structure code into classes, create a class hierarchy and manage the visibility of data throughout a system.

But in the JavaScript code, private members are publicly accessible. However, it is possible to hide methods and variables within JavaScript by placing them within a constructor function and making them accessible to the class internals through a closure.

Modules

TypeScript uses the concept of internal and external modules.

In the case of JavaScript, every variable/- function that isn’t defined in a function is created in a global scope. Variables defined without a “var” keyword will also be created. Cluttering the global namespace will cause naming conflicts. If this happens, variables or functions in the global scope will override existing ones with the same name and can create some untraceable errors.

TypeScript’s internal modules follow the same structure as namespaces as they allow defining of symbols like variables classes and the global scope. External modules are how TypeScript defines asynchronous loaded modules for either node.js or require.js module-loadingsystems.TypeScript also employs the use of a module to declare the application program interfaces that third-party libraries expose.

TypeScript Benefits

Here are some benefits that make Type- Script a prominent language:

  • A platform for safe and automatic refactoring.
  • High-visibility APIs and type declaration code contracts.
  • Easy error detection during compilation.
  • Class-based object orientation, with private members and an interface module support.
  • Easy interoperability of JavaScript code.
  • It allows you to convert any JavaScript code into a valid TypeScript code.
  • There is low or no risk in trying Type- Script since it can be removed as easily as it was installed.

The best part about TypeScript is that it allows you to begin with a JavaScript code and eventually add type annotations.

TypeScript Cons

Although TypeScript comes with loads of features and advantages, TypeScript also has its fair share of cons and limitations. So here are a few drawbacks of Type- Script compared to JavaScript:

      • To obtain the most out of TypeScript, developers are required to employ the use the type annotations at every point of their code, making such a dynamic language seem tedious and cumbersome. So, you’re going to have to devote plenitude of focus and effort while writing a strongly-typed JavaScript code.
    • Although the TypeScript system is way more flexible than what one typically finds among mainstream languages, it is still nowhere as flexible as the JavaScript language itself. In fact, JavaScript extends itself to a strong deal for TypeScript since it imposes a strongly-typed language system to make it easier to use with JavaScript, which is intrinsically dynamic.
  • Not all JavaScript patterns are 100% compatible with TypeScript. In fact, many commonly used JavaScript patterns can be difficult or impossible to use in Typescript. And although developers are working to create a smoother integration, it will take a couple of years to reach that point.

Why to use TypeScript:

Transparency:

TypeScript is a language that generates plain JavaScript files. The code produced follows all the JavaScript rules (the “good parts”) and thus is clean and modular (one file per class). You can export namespaces (modules) and to be honest most of the time the produced JavaScript is fairly the same as what we can do.

Developer Reach:

Furthermore, we can reach more users who can be afraid by JavaScript. Type-Script is for instance a good way for C#, Java and all strong typed languages developers to start developing for the web.

It technically boils down to its usage, for example, using TypeScript is much more advantageous for medium-large scale projects, but might not make as much sense for smaller projects.

Example:

As an example, here’s some Typescript (you can play with this in the Typescript Playground) and the Javascript code that it would produce.

Notice how the Typescript defines the type of member variables and class method parameters. This is removed when translating to JavaScript, but used by the IDE and compiler to spot errors, like passing a numeric type to the constructor.

typescript vs javascript

It is by no means an improved version of JavaScript, nor a complete replacement for the same. In fact, in order to use and make the most out of TypeScript, a developer or development team will need to be fairly well-versed with TypeScript as well as JavaScript.

SNEAK PEEK INTO CSS4

SNEAK PEEK INTO CSS4

Internet is a medium which evolves constantly and it is very hard to believe that CSS is nearing release of version 4. CSS4 has emerged as a buzzword in web technology arena with CSS Working Group’s release of first working draft on the same. World Wide Web Consortium, the governing body that oversees the development of web standards is already plotting the future of CSS with CCS4. Although CSS4 will not replace CSS3, the work on specifications will go on parallel with CSS3 modules. There are many innovative proposals in CSS4 including parent selector, UI states pseudo classes, reference combinators, logical combinations and namespaces. It has been reported that there is a proposal for responsive design in CSS4 and it will let a web developer apply preload states for slow connections.

Cascading script sheet is another much talked about feature of CSS4 and it will be extremely useful for enhancing interaction. According to seasoned web developers, CSS4 technology uses unobtrusive and function style syntax. CLISS (Command Line Interface Styling Script Sheet) is another best feature and it follows a very similar syntax to the CSS. Another fascinating attraction of CSS4 is proper email styling support and it is almost similar to CSS3. With the introduction of this web technology, some old properties have been reintroduced and some are introduced for the first time.

Parent Selector

Parent selector allows a web designer to style a parent element based on its child element and it is one of the favorite selectors of passionate web developers.

Reference Combinators

Reference combinator consists of two slashes in between CSS qualified names and these slashes are used to define the association between two compound selectors.

Location Pseudo-Classes

CSS4 has added few interesting pseudo classes to handle links such as :any-link, :local-link, :target, :scope, :link and :visited.

UI States Pseudo Classes

CSS4 introduces a set of UI states that will allow us to style elements depending on their user interface state. :enabled, :checked, :default, :valid and :invalid are the pseudo classes introduced in CSS4.

Logical Combinations

New logical combination pseudo class called: matches ( ) is one of the innovative attractions of CSS4.

It is learnt that some more features will be added to CCS4 very soon and they will undoubtedly make the experience of web developer easier. Variable declaration feature in CSS4 will reduce the amount of code redundancy experienced in previous versions of CSS4. It is brand new and no web browser actually supports these features of Cascading Style Sheet 4 yet. As CSS4 is built on CSS3, it is desirable to continue mastering CSS3, its features and applications.

As CSS4 is a work in progress, many of the new features may be removed in a later stage. As per industry reports, its new media features will probably include script, pointer, hover and luminosity. When CCS3 was introduced, neither its developers nor others thought that it would become so popular. It is perceived that the same miracle will happen in the case of CSS4 too. Web developers are quite fascinated by the elegant features of CSS4 and they are eagerly anticipating for its official release.

Why is Yeoman getting popular? What all can a developer do with it?

Why is Yeoman getting popular? What all can a developer do with it?

Yeoman is an open sourced web development tool that has unleashed a new wave for developers. Today, in the web app world there is a current trend of using development tools that provide application framework. Yeoman is a web tool that embodies the current trend of the Indus try, and takes it to the next level! If you are a developer at any stage of experience this tool will come as a delightful surprise. Without a doubt this is one of the best innovations to come to web development in a long time. Since the Google/IO release of Yeoman in 2012, it has been regarded as an innovative step forward into the future of web developing.

There is a significant amount of excitement around Yeoman due to the streamlined experience of their less complicated take on modern webapp development. Essentially, the pace at which you can create anything from a simple project to a high caliber web application is impressively quick! In addition to that, Yeoman also allows you to automate the common cumbersome tasks of web developing. This is a development tool that packs a ton of awesome stuff in one package. You can build beautiful and bold designs unlike ever before. Yeoman has a host of features(many of them are open sourced) that are developer-friendly and make the process of developing a high quality web app less of a hassle.

For starters, Yeoman is comprised of “yo” and his helpful partners “Grunt” and “Bower.” These three tools are at the core of the Yeoman experience and enable the application to work at a speedy yet highly effective pace. The first tool “yo” is a web scaffolding tool, yo is a generator that prescribes scribes most of the work for you using tools and best practices to increase fluidity and productivity. The second is “Bower” which is a package manager that allows you to seamlessly multitask and manage all your projects dependencies. The last of the three core tools is “Grunt” which is essentially a task based command line tool for Javascript projects. Yeoman provides linting, quick and easy operation of essentials like coffeescript and sass/scss, CDNifying and automated JS/CSS.

Overall, it is likely to decrease your front end/back end workload, solving a lot of your time consuming problems. Yeoman acts as a kick starter generating infrastructures that get you up to speed on projects. All of the frustration and hours spent dealing with the intricacies of web building have been cut in half and your workload has been modernized with a “made simple” approach. One of the stand outs with this application is that work flow is more consistent. Yeoman really lets you get right down to writing code through optimizing a lot of the repetitiveness of web building.

Many skeptics feel like Yeoman may be a bit too much to process and an intimidating tool to wrap their heads around. Yeoman attests that they optimize the building process, making the experience efficient, simpler and overall more enjoyable. Google assures that the configuration process and the maintenance of the important “nuts and bolts” of web application are streamlined and made easy, this has never been done before to this level. What Yeoman does exceptionally well is serve as an automating tool, automation equals happiness for the developer. You are now backed by an experienced community of developers who save you time and frustration by alleviating you from many of the technical tasks that stagnate the creative process of web app building.

Yeoman also brings swagger and a popularity among the community that most development companies don’t experience; it is quickly becoming the People’s Champion and go-to tool for web development.

If you are still wondering why Yeoman is garnering the attention and praise from the developer community, the answer is simple – Yeoman embodies efficiency and accessibility. One thing is for sure, Yeoman is a step forward towards the future of web app development. “Work Less, Do More, and Make Awesome” is a quote from Addy Osmani who is a Developers Programmer Engineer at Google. This is what Yeoman stands for in the developer community.

By deciding to use Yeoman you are saying that you want more control at your hands. This is an application geared toward making the lives easier of the novice developer and the expert, while ensuring your overall creative experience is more enjoyable and efficient no matter how simple or complex the project is. Beyond the initial factors that make Yeoman popular today, what should be noted is its ability to enable the user to be more creative. With so much of the workload time reduced due to the streamlined process, Yeoman is more flexible, allowing you to do things at a fluid pace not quite seen to this level before. Improving productivity and creativity is what brings Yeoman to the forefront.

WHICH TECHNOLOGY SKILL PAYS MORE?

WHICH TECHNOLOGY SKILL PAYS MORE?

Technology has penetrated every sphere of life, big and small and almost every single human today relies on it in some way or the other. This is the reason why conventional high paying professions had to humbly make way for Software development, Software Design, Data Governance, Website/Mobile Development, Instructional Design, Technological R&D etc. The nerds had officially arrived and they’d be here for a very long time. The IT industry, in its perpetually evolving nature seeks skilled personnel that would eventually become cogs in its huge wheel. These personnel however, always need to keep updating themselves and learn more to avoid becoming fossils. With this thought in mind, we had set out on the task of finding out which technological skill is paid the most.

This article presents the data collected from surveys conducted by StackOverflow and IT Recruiters from multiple staffing agencies. According to the report, more than 25000 developers participated in answering the question of which technological skill was highly paid.

Take a look at the average salary of a 2 years experienced developer:

StackOverflow and IT Recruiters

Web UI topped the list with an average potential annual income of a little under $ 99,320 per annum. It is worth mentioning here that JavaScript, a technology that has been around for two decades, makes the list grossing almost $90,000 a year. This technology’s effectiveness and user-friendliness is expounded by the fact that despite stiff competition and copious emergence of new development technologies, it has still held its ground and remains as one of the top paid technologies in the world.

According to industry experts, developers possessing expertise in niche technologies are those that shall be at the top of the pay pyramid. It goes without saying that in this day and age where competition has become so cut-throat that only the fittest survive and only the fittest among these fittest become leader.

The survey also has good news for those who wish to expand their inventory of skills and want to know where the really big money lies.

TOP PAYING TECHNOLOGIES

Top_Paying_ Technologies.jpg

As above mentioned technologies are still an emerging phenomenon, industry stalwarts are willing to pay huge salaries to those proficient in these technologies.

COMPENSATION BY REMOTE STATUS

Freelancers have good reason to rejoice because this survey tells us that those who freelance professionally/fulltime, earn more than 40% compared to those who don’t. Being a freelancer has its own perks and advantages. It allows one to learn a lot, as there’s nobody to go and seek assistance from, mistakes and experience are the only two teachers and none can ever be better than them when it comes to imparting knowledge. It gives one the courage to experiment, take risks, explore avenues and aspects that those working for an organization will generally not have the liberty to.

Compensation_by_remopte_status.jpg

The market with its insatiable demand for talented UI developers is attracting those armed with the aforementioned technologies. Marketable skills in UI development include front-end web development, interactive media design, human-computer interaction, usability testing, mobile development, graphic design and team-centric soft skills, such as effective interpersonal communication, leadership and project management. Mastering any and preferably many of these technologies will ensure that you stand out in the crowd, create a niche brand of your own and will make you a highly coveted developer that companies would vie each other for

How to use node-inspector with Grunt tasks?

How to use node-inspector with Grunt tasks?

Node Inspector is a debugger interface for Node.js applications that uses the Developer tools formerly WebKit Web Inspector. We can use node-inspector to debug grunt task. Node-inspector has the command node-debug, which launches node in a debug state and opens the browser to the node-inspector page, stopping when it hits the first debugger line or set breakpoint.

 

Strict vs. quirks modes – How to trigger each and why this matters?

Strict vs. quirks modes – How to trigger each and why this matters?

Quirks mode and strict mode are the two ’modes’ modern browsers can use to interpret your CSS.

Anything before the DOCTYPE, like a comment or an XML declaration will trigger quirks mode in Internet Explorer 9 and older versions.

In HTML5, the only purpose of the DOCTYPE is to activate full standards mode. Older versions of the HTML standard gave additional meaning to the DOCTYPE, but no browser has ever used the DOCTYPE for anything other than switching between quirks mode and standards mode.