Changes

Jump to navigation Jump to search

Sample page

1,261 bytes added, 11:43, 1 July 2021
no edit summary
<code>Source code</code> -> used for code examples, on many pages pre (blue box) is used for code which should be replaced
 
 
<div style="background-color: #f8f9fa !important; border: 1px solid #eaecf0;border-radius: 2px; padding: 1px 4px;">
<script>
<nowiki>
var addUrlParamsToIframeSrcs = function () {
const validParameters = ["checkin","checkout","numnight","numadult","numchild","ownerid","propid","roomid","referer","redirect","lang","group","nogroup","category1","category2","category3","category4", "customParameter"];
const iframeAttrIdentifier = "ourIframe";
const currentUrl = new URL(window.location.href);
let parametersString = "";
validParameters.forEach(parameter => {
const parameterValue = currentUrl.searchParams.get(parameter);
if (parameterValue !== null) {
parametersString += "&" + parameter + "=" + parameterValue;
}
});
const iframes = document.getElementsByTagName("iframe");
for (let iframe of iframes) {
if (iframe.getAttribute(iframeAttrIdentifier) !== null) {
let iframeSrc = iframe.getAttribute("data-src");
if (!iframeSrc.includes("?")) {
iframeSrc += "?";
}
iframeSrc += parametersString;
iframe.setAttribute("src", iframeSrc)
}
}
}
addUrlParamsToIframeSrcs();
</nowiki>
</script>
</div>
:{

Navigation menu