本文介紹了如何在 spidermonkey JavaScript 中獲取控制臺輸入?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我目前正在使用 spidermonkey 來運行我的 JavaScript 代碼.我想知道是否有一個函數(shù)可以從控制臺獲取輸入,類似于 Python 的做法:
I'm currently using spidermonkey to run my JavaScript code. I'm wondering if there's a function to get input from the console similar to how Python does this:
var = raw_input()
或者在 C++ 中:
std::cin >> var;
我環(huán)顧四周,到目前為止我發(fā)現(xiàn)的只是如何使用 prompt()
和 confirm()
函數(shù)從瀏覽器獲取輸入.
I've looked around and all I've found so far is how to get input from the browser using the prompt()
and confirm()
functions.
推薦答案
好老的readline();
.
參見 MDN(存檔).
這篇關(guān)于如何在 spidermonkey JavaScript 中獲取控制臺輸入?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!