質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
JavaScript

JavaScriptは、プログラミング言語のひとつです。ネットスケープコミュニケーションズで開発されました。 開発当初はLiveScriptと呼ばれていましたが、業務提携していたサン・マイクロシステムズが開発したJavaが脚光を浴びていたことから、JavaScriptと改名されました。 動きのあるWebページを作ることを目的に開発されたもので、主要なWebブラウザのほとんどに搭載されています。

Q&A

1回答

808閲覧

ショートカットというアプリを使って、webサイトでカラーピッカーを使用したいのですが...

qlqlql

総合スコア0

JavaScript

JavaScriptは、プログラミング言語のひとつです。ネットスケープコミュニケーションズで開発されました。 開発当初はLiveScriptと呼ばれていましたが、業務提携していたサン・マイクロシステムズが開発したJavaが脚光を浴びていたことから、JavaScriptと改名されました。 動きのあるWebページを作ることを目的に開発されたもので、主要なWebブラウザのほとんどに搭載されています。

0グッド

1クリップ

投稿2021/12/16 02:38

編集2021/12/16 02:58

全然スクリプトとかが分からずショートカットというアプリにコードをペーストしたのですが使えないとのことです。
ショートカットというアプリでJavaScriptというのを使いたく色々試したりしたのですがsyntax errorやunexpected?が表示されてしまい、出来なくて困っています。
誰かプログラミングに詳しい人に聞けばなんとかできるかな…と思い質問しました。

<head> ... <link rel="stylesheet" href="pickr.min.css"> </head> <body> ... コンテンツ ... <script src="pickr.min.js"></script> </body> Step 2: HTML カラーピッカーを配置する要素を用意します。 HTML <div class="color-picker"></div> Step 3: JavaScript カラーピッカーを配置する要素を指定し、スクリプトを実行します。 JavaScript const pickr = Pickr.create({ el: '.color-picker' }); オプションでは、初期表示、ボタンの有無などを設定できます。 オプション const pickr = new Pickr({ // Selector or element which will be replaced with the actual color-picker. // Can be a HTMLElement. el: '.color-picker', // Default color default: 'fff', // Option to keep the color picker always visible. You can still hide / show it via // 'pickr.hide()' and 'pickr.show()'. The save button keeps his functionality, so if // you click it, it will fire the onSave event. showAlways: false, // If the color picker should have the body element as it's parent. appendToBody: false, // Close pickr with this specific key. // Default is 'Escape'. Can be the event key or code. closeWithKey: 'Escape', // Defines the position of the color-picker. Available options are // top, left and middle relativ to the picker button. // If clipping occurs, the color picker will automatically choose his position. position: 'middle', // Show or hide specific components. // By default only the palette (and the save button) is visible. components: { preview: true, // Left side color comparison opacity: true, // Opacity slider hue: true, // Hue slider // Bottom output bar, theoretically you could use 'true' as propery. // But this would also hide the save-button. output: { hex: true, // hex option (hexadecimal representation of the rgba value) rgba: true, // rgba option (red green blue and alpha) hsla: true, // hsla option (hue saturation lightness and alpha) hsva: true, // hsva option (hue saturation value and alpha) cmyk: true, // cmyk option (cyan mangenta yellow key ) input: true, // input / output element clear: true // Button which provides the ability to select no color }, }, // Button strings, brings the possibility to use a language other than English. strings: { save: 'Save', // Default for save button clear: 'Clear' // Default for clear button }, // User has changed the color onChange(hsva, instance) { hsva; // HSVa color object, if cleared null instance; // Current Pickr instance }, // User has clicked the save button onSave(hsva, instance) { // same as onChange } }); コード

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

m.ts10806

2021/12/16 02:43

JavaではなくJavaScriptでは。 あとコードはマークダウンのcodeにてご提示ください
m.ts10806

2021/12/16 02:44

>ショートカットというアプリでJavaScriptというのを使いたく その「ショートカット」とはなんでしょう。公式ページURL提示してください。それ次第に思いますし、現状起きてる問題は何でしょうか。 「できなかった」だけでは何も伝わりませんので。
qlqlql

2021/12/16 02:59

内容を変更しました。
guest

回答1

0

「ショートカット」とは、iOSの公式タスクアプリのことですよね?
「ショートカット」での「WebページでJavaScriptを実行」はHTMLベースではなくて、純粋に JavaScript だけを書いてください。

iPhoneまたはiPadの「ショートカット」の「WebページでJavaScriptを実行」アクションの概要 - Apple サポート (日本)

投稿2021/12/16 07:35

編集2021/12/16 07:36
Lhankor_Mhy

総合スコア36115

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問