javascript styles
Are you using "" or '' in javascript?
Are you using ; or none at the end of line?
Let's see how to use it in open source.
1.jQuery
using : "" and ;
API example
$.ajax({
url: "/api/getWeather",
data: {
zipcode: 97201
},
success: function( result ) {
$( "#weather-temp" ).html( "" + result + " degrees" );
}
});
Code example
https://github.com/jquery/jquery/blob/main/src/core/ready.js
if ( document.readyState !== "loading" ) {
window.setTimeout( jQuery.ready );
}
2.bootstrap
using : '' and none
Code example
https://github.com/twbs/bootstrap/blob/main/js/src/button.js
const NAME = 'button'
const DATA_KEY = 'bs.button'
const EVENT_KEY =.${DATA_KEY}
const DATA_API_KEY = '.data-api'
3.angular
using : '' and ;
https://github.com/angular/angular/blob/main/packages/core/src/application_tokens.ts
export const PLATFORM_ID = new InjectionToken('Platform ID', {
providedIn: 'platform',
factory: () => 'unknown', // set a default platform name, when none set explicitly
});
4.vue
using : '' and none
https://github.com/vuejs/vue/blob/main/src/core/components/keep-alive.ts
function matches(
pattern: string | RegExp | Array,
name: string
): boolean {
if (isArray(pattern)) {
return pattern.indexOf(name) > -1
} else if (typeof pattern === 'string') {
return pattern.split(',').indexOf(name) > -1
} else if (isRegExp(pattern)) {
return pattern.test(name)
}
return false
}
5.react
using : '' and ;
https://github.com/facebook/react/blob/main/packages/react-dom/src/client/ReactDOM.js
function createPortal(
children: ReactNodeList,
container: Element | DocumentFragment,
key: ?string = null,
): React$Portal {
if (!isValidContainer(container)) {
throw new Error('Target container is not a DOM element.');
}
return createPortalImpl(children, container, null, key);
}
Leave javascript styles to:
Read more #javascript posts
Best Posts From suseona
We have not curated any of pishio's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From suseona
- Grid Bot Trading
- Write on blog.suseona.com and Get 100% Upvotes from @pishio!
- Security Update: Stronger Protection for Your Hive Keys
- AI Summary and Q&A Feature Now Available on blog.suseona.com
- AI Summary and Q&A Feature Now Available
- Suseona Weekly Contest – Week 1
- blog.suseona.com updates
- Hive Note MCP in the Claude Code
- Discovering Hive Note!
- The Rollercoaster of Trading: Chasing Profits in the Digital Wild West