Notepad++ select javascript content
Jak vybrat kód mezi taky v Notepad++
How to select f.e. javascript tag contetn in Notepad++
- insert content between braces
- put caret behind the last bracket
- press Ctrl + left Alt + B or Ctrl + Shift + B to control the first brace
from parentheses to braces and check the multi-line box.
Then you can Ctrl-double-click on either brace to highlight everything in between.
How to select f.e. javascript tag contetn in Notepad++
- insert content between braces
- put caret behind the last bracket
- press Ctrl + left Alt + B or Ctrl + Shift + B to control the first brace
< script>
{
var bla = 0;
// bla bla ... long content
} // place caret/cursor behind the last brace { and press Ctrl + left Alt + B (Notepad++)
< /script>
At Settings->Preferences->Delimiter, change the delimiters
from parentheses to braces and check the multi-line box.
Then you can Ctrl-double-click on either brace to highlight everything in between.
77LW NO topic_id
AD
Další témata ....(Topics)
Kontrola zda database existuje, zmena opravneni, vytvoreni nove, nebo jeji otevreni kdyz existuj
$path_to_database = "CESTA_K_SOUBOURU/database.sqlite";
// zmena opravneni / chmod permission
if(file_exists($path_to_database))
chmod($path_to_database,01777);
// otevreni , vytvoreni databaze
$db = new SQLiteDatabase($path_to_database);
vlozeni tabulky s nazvem test, mozno bezpecne vkladat text v UNICODE
$db->query("
CREATE TABLE test
(url VARCHAR(55),
title VARCHAR(55),
keywords VARCHAR(500),
content_of_page VARCHAR(2500),
date DATE(50),
revision DATE(50),
visit INTEGER(8),
PRIMARY KEY (url),
UNIQUE (url))");
// vlozeni dat do tabulky test
$query = $db->query("INSERT INTO test (url,title,keywords,date,c,visit) VALUES (""
.$url."",""
.$title."",""
.$"keywords."",""
.$datum."",""
.$text_of_page."",""
."1"."")", $error);
// update tabulky / radku, prepis jiz existujicich dat
$query = $db->query("UPDATE test SET $query = $dbb->query("UPDATE test SET obsah="".$text_novy
."", title="".$title_new
."", keywords="".$keywords_new
."", revision="".date("j.n.Y - H:i")
."" WHERE url="".$url.""", $error);
}
if (!$query) {
exit("Error in query: "$error"");
} else {
echo "Number of rows modified: ", $dbb->changes();
}
// vyber vsech dat z tabulky test
$resss = $db->unbufferedQuery("SELECT * FROM test");
// prochazeni vysledku vyberu z tabulky
foreach ($resss as $row) { // iterate through result object
print $row["url"];
print $row["title"];
// atd. .... etc. ....
} // end foreach
// presne hledani v tabulce nebo substring / pokud hledame jen substring tak dame % pred pokude ma byt cokoliv vpredu, nebo za pokud vzadu
// pokud jsou procenta vpredu i vzadu, tak najde napriklad predblablavzadu
$resss = $db->unbufferedQuery("SELECT * FROM test WHERE title LIKE %blabla%");
// ziskat setrideny vyber a max pocet vybranych poloze / na konec dotazu pridame:
ORDER BY title DESC LIMIT 50
// setridi podle tituku a vybere 50 radku
// smazani urciteho radku dle obsahu nektereho ze sloupcu
$ur = "www.domena.com/blahblah.php"
$query = $dbb->query("delete from test where url like "$ur"");
CORS-Cross-Origin-Resource-Sharing Header set Access-Control-Allow-Origin Source Code Example
Usefull Links here
https://www.w3.org/wiki/CORS_EnabledApache .htaccess Allow File Types
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
<FilesMatch ".(bmp|cur|gif|ico|jpe?g|png|svgz?|webp)$">
SetEnvIf Origin ":" IS_CORS
Header set Access-Control-Allow-Origin "*" env=IS_CORS
</FilesMatch>
</IfModule>
</IfModule>
.htaccess which is closest to the file!!!!!
Date: 17.06.2020 - 08:09 For all browsers e.g. old IE 11 ....
<script>
var mbThreadOneRunning = false;
var mbThreadOneEnded = false;
var mbThreadTwoRunning = false;
var mbThreadTwoEnded = false;
// you can create more than one Thread
// setTimeout() used for running more Threads at once
var timeout_1 = setTimeout("ThreadOne()", 5000); // 5000 == 5 second
var timeout_2 = setTimeout("ThreadTwo()", 3000); //
function ThreadOne() {
mbThreadOneRunning = true;
alert("1. ThreadOne working!");
// working code here .............
mbThreadOneEnded = true;
clearTimeout(timeout_1);
}
function ThreadTwo() {
mbThreadTwoRunning = true;
alert("2. ThreadTwo working!");
// working code here .............
mbThreadTwoEnded = true;
clearTimeout(timeout_2);
}
var mInterval = setInterval("checkThread()", 1000); // 1000 ms == 1 second, you can put smaller value
function checkThread() {
if (mbThreadOneEnded == true) {
alert("1. checkThread() ThreadOne finish work! " + mbThreadOneEnded);
}
else if (mbThreadTwoEnded == true) {
alert("2. checkThread() ThreadTwo finish work! " + mbThreadTwoEnded);
}
if (mbThreadOneEnded && mbThreadTwoEnded) {
clearInterval(mInterval); // just to be sure
mbThreadOneEnded = false;
mbThreadTwoEnded = false;
alert("ThreadOne and ThreadTwo ended ");
}
}
</script>
Jak zjistit v javascriptu zda objekt existuje
How test if an object exists undefined or null.
if (typeof OBJECT_NAME != "undefined") {
//object exists ... execute code here.
}
// or best of use try catch
var nObject;
try{
nObject = image.image; // is image.image object?
}catch (e){
alert(e.message.toString()); // e.message == 'undefined' is null or not an object
return; // or continue if image.image is a object
}
// you can test now nObject as typeof nObject
if(typeof nObject == 'string') // or others etc.
{
// do something
}
// dont use this
if (OBJECT_NAME != null) {
//if object dont exists will error
}
Editace: 14.5.2020 - 11:03
Počet článků v kategorii: 77
Url:notepad-select-javascript-content-id-2346