web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

How to change the language of a marketing form hosted as iframe

(0) ShareShare
ReportReport
Posted on by 6

Hi,

I have created a Marketing form hosted that into webpage as an Iframe and I want to change the language of form by using query parameter in url . For that I have added below Javascript/Jquery code to the HTML of Marketing form but JS code is not working nor I am able to debug the code as it is inside the Iframe.Below is my code:

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function getParameterByName(name, url) {
debugger;
if (!url) url =window.parent.location.href;
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
}


var dynamicContent = getParameterByName('lang');

$(document).ready(function () {
debugger;
// $('#lang').val('eng');
// $('#lang').on('change', function() {
console.log('click');
if (dynamicContent == "en") {
debugger;
$(".cls_email").html("E-mail");
$(".cls_company").html("Company");
$(".cls_name").html("Name");
$(".cls_surname").html("Last Name");
$(".cls_submit").html("Submit");

}
});

Can Anyone Suggest any way to change the language of the form?
Thanks.

I have the same question (0)
  • Suggested answer
    Petr Jantac Profile Picture
    Microsoft Employee on at

    Hi,

    I think you may have a problem accessing the URL of the parent page from iframe. If the parent page and iframe are not on the same domain/subdomain it can be considered as cross site scripting and blocked by the browser.

    Petr

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 209 Super User 2026 Season 1

#2
CU11031447-0 Profile Picture

CU11031447-0 100

#3
NeerajPawar Profile Picture

NeerajPawar 71

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans