# hw4-jQuery v.s javascript

@Version:V1

@Date:2017-10-22

@Author:顏慷

> ## 問題一：舉出三個javascript做得到，但是jQuery做不到的事

## 範例一：else與 if 的判斷

* jQuery是javascript的library，而大多jQuery的使用，多數是enhance 網站的開發或是解決早期多種瀏覽器的規格問題，但是對於細部的狀態判定，卻無法像javascript去實作，具體來說，我在寫小tool時思考，如果一張照片要用rainbow filter去實作，javascript是比jQuery更好的工具。

![](/files/-LcGkTMCVu5WW1so6Tj6)

## 範例二：data manipulation on server

* 在javascript中，Node.js是一個基於Chrome JavaScript運行時的一個平台，也能說是在運行服務端的JavaScript。
* 而在javascript中，需要做一些後端sever的data manipulation，這一點，jQuery是做不到的。

![](/files/-LcGkTMEfNIjNzE0QWer)

## 範例三：Electron

* Electron是一個framework，目的是build一個跨平台的desktop apps with JavaScript, HTML, and CSS，舉例來說，Github Desktop就是當中一product.
* 因為，electron是node.js 的整合關係，而有很多額外的symbols加入進去DOM(文件物件模型 Document Object Model)，像是module, exports, require，
* 所以jQuery在使用時，不能直接以jQuery 的形式include，這樣會出現undefined的問題，必需要以jQuery package of NPM(Node Package Manager，即node包管理器)來使用，並且用require function來使用jQuery。

> ## 問題二：舉出以前認為jQuery可能做得到，但是後來發現其實沒辦法做到的例子

* 第一印象，覺得jQuery主要負責網頁前端的技術，像是alter the content of page 還有 add animation to a page，也覺得jQuery能處理data前端到後端的資料傳輸，
* 但是後來發現，jQuery最多能做到retrieve information from a server without refreshing a page，至於後端data的manipulate或是complex的data transformation是無法做到的。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://yenkang-2.gitbook.io/advanced-software-engineering/hw4-jquery-vs-javascript.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
