@dovid אמר באיך אני מקבל מידע מאתר חדשות?:
.then(txt => $w("#someElement").text = txt.match(/<title>([^<]+)</)[1]) );
קצת ערבבתי. אז אולי בגלל זה אני טועה.
בצד לקוח כתבתי כך
import { buttonTestFetch } from 'backend/site';
export function button62_click(event) {
let submitRequestData = {
"url": $w('#input12').value
}
buttonTestFetch(submitRequestData)
.then((log) => {
console.log(log);
})
}
בצד שרת כתבתי כך
export function buttonTestFetch_click(submitRequestData) {
fetch(submitRequestData.url, {method: 'get'})
.then(response => response.text())
.then(txt => {
let log = (txt.match(/<title>([^<]+)</)[1])
return (log) ;
})
}
זה מה שמדפיס לי:
TypeError: (0 , _site.buttonTestFetch) is not a function