Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
Has anyone here used KSS?
KSS is an AJAX framework.
KSS has both a client-side Javascript library and server-side support.
The client-side Javascript library needs to be included in your page. It fetches Kinetic style sheets from the server, parses them and binds a set of action to browser events and/or page elements. It is clean Javascript code that can peacefully coexist with other clean Javascript librarys(sic) like JQuery or ExtJS. It is about 100k in production mode. You can integrate your own Javascript code by using its extension mechanism through plugins.
I'm currently working on a project that uses it. Are there any drawbacks and gotchas to be aware of?
What's its cross browser support like?
At first as was really put off by the fact that you don't write the JS by hand, and actually translates a CSS-like file to JS behavior, but seeing in action, I've got to say that it really works quite well. But I haven't done any cross browser tests yet.
Some things that I've found:
it sends HTML from the server, instead of XML and/or JSON and replacing them clientside, meaning higher messages (understandable)
it has problems with scripts that add iframes dynamically on a KSS widget that you reload
some things are hard to debug, while others are made easy thanks to KSS' integration with Firebug
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I'm looking for simple bullet point answers please. I've tried looking all over, Googling, other questions here but I can never find both advantages and disadvantages for each method.
This is the answer I got from W3Schools pertaining to external javascript files
Pros
It allows separation of concerns - which is not a big deal in simple pages but as the script grows larger you can have a monolithic html page. Big files in general are not ideal for maintainability
It allows caching - when the browser loads a script externally (whether it's be from your site or a cdn) it caches the file for future use. That's why cdn's are preferred for commonly used scripts. Makes the browser use a cached script instead of building a new one every time the page loads which makes the page load faster
More readable code - this ties into the first bullet point but nevertheless it is important. The smaller the files we humans are working with the better. It is easier to catch mistakes and much easier to pass of the torch to the next developer working on the project or learning from it.
Cons
The browser has to make an http request to get the code
There may be other browser specific reasons as well, but I believe the main reason is the separation of code into different components.
Probably the best advantage of using external javascript files is browser caching - which gives you a good performance boost.
Imagine you have a site that uses MyJsFile.js (a random 50kb javascript file that adds functionality to your websire).
You can:
embed it in every page, and add the 50kb to every page request (not ideal)
link it in every page (<script src="MyJsFile.js"></script>)
The second option is usually prefered because most modern browsers will only get the file once, and serve it from the browser cache instead of downloading it at every request.
Check out similar questions:
Why not embed styles/scripts in HTML instead of linking?
When should I use Inline vs. External Javascript?
Is it better to put the JS code on the html file or in an external file?
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
So, a while back I wrote a script in Python to automatically register me to classes in my school (by creating a browser with mechanize and signing in with my user/password and clicking the buttons etc)
lately I've been trying to learn JavaScript/html/css and I was thinking JavaScript would be better suited for such stuff, but I don't really understand the concept of how it will work yet, because the only way I've seen JavaScript used is linked from an html file and then run when you load the html.
I was wondering how would I create a standalone JavaScript to do those kind of stuff without html and how would I run it? (Do I download an interpreter of some kind?)
I could find information about that kind of stuff through Googling though i'm sure it's there I just don't know what this is called (tried web mining and web crawling but it doesn't seem to be it)
No, wrong use. If you are going to try to use JS externally to manipulate a browser page, you are going to have to open a web console on your browser then paste the code in, which is totally impractical.
Node.js does let one write Javascript that has full file system access, etc. to your computer, so this would be your best bet, but your question is pretty vague so I can't tell if this is exactly what you would need.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I understand the basic principles of script/style compression. What I would like to know is how do I integrate minified/combined scripts into my process and not interrupt my normal development flow?
I obviously want to use the regular files while developing then switch to the minified versions for deployment. I currently use YepNope to load my scripts. Is there some sort of conditional I could use to tell the browser to load the regular files?
Environment: VS 2010
My solution to this was to go with Microsoft's own Ajax Min its pretty nice. Compression is on par with some others I used.
As far as telling the browser to load minified versions or full, I added that into the post build script. Basically if you are in this particular environment then do not build the minified versions. Then in the js I have a little flag that points to one or the other depending on environment.
Hope this helps.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Hey, I am a newbie to JavaScript. I really don't know what it does.
What can I do with JavaScript?
What are the possibilities of JavaScript?
What tools will I require to develop in JavaScript?
Is there some plugin available in Eclipse?
Thanks!
Javascript is a programming language.
You can do anything with it that you can do with other programming languages.
As with other languages, you need a text editor and a compiler/interpreter in order to develop with it.
It is mostly used with websites to provide better interaction than HTML can do alone and most web browsers have a built in interpreter for javascript. For security reasons, javascript in the browser is limited (so it can't directly access the filesystem, for example).
See this list of resources for further learning.
Javascript is a programming language used, in context of web sites, to implement behavior function to a page on client side. Using HTML and CSS only, with no Javascript, you can only show things in a pre-defined way. With Javascript, you can control the way things behave.
You can use whatever text editor you like to write Javascript code, and a web browser to run it.
JavaScript is well-suited for performing task within a web browser.It is primarily used to interact with users.
With JavaScript you can do:
it can change HTML content, HTML styles, HTML attributes.
it can detect what browser a person is using and customize the webpages to their browser.
it can validate date.
perform calculation in forms.
validating form input.
interact with multiple frames.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Is there any python module for rendering a HTML page with javascript and get back a DOM object?
I want to parse a page which generates almost all of its content using javascript.
The big complication here is emulating the full browser environment outside of a browser. You can use stand alone javascript interpreters like Rhino and SpiderMonkey to run javascript code but they don't provide a complete browser like environment to full render a web page.
If I needed to solve a problem like this I would first look at how the javascript is rendering the page, it's quite possible it's fetching data via AJAX and using that to render the page. I could then use python libraries like simplejson and httplib2 to directly fetch the data and use that, negating the need to access the DOM object. However, that's only one possible situation, I don't know the exact problem you are solving.
Other options include the selenium one mentioned by Łukasz, some kind of webkit embedded craziness, some kind of IE win32 scripting craziness or, finally, a pyxpcom based solution (with added craziness). All these have the drawback of requiring pretty much a fully running web browser for python to play with, which might not be an option depending on your environment.
You can probably use python-webkit for it. Requires a running glib and GTK, but that's probably less problematic than wrapping the parts of webkit without glib.
I don't know if it does everything you need, but I guess you should give it a try.