Aurigma Forums
»
Customer's Canvas
»
Discussions – Customer's Canvas
»
Load stateId with iFrame API - How do I load a state Id dynamically using the Iframe API?
Rank: Advanced Member
Groups: Member
Joined: 3/20/2018(UTC) Posts: 61
Thanks: 4 times
|
I'm trying to lord State id in iframe.
it's works when i put stateid directly, but don't works when put it like a variable.
there is my code
var configuration = { widgets: { FinishButton: { mode: "Disabled" } }}; var editorFrame = $("#editorFrame");
var editor = null;
function handleError(error, message) { console.error(message, error); return error; };
var loadData = null; var userId = "anonymous_1rxtizfpvjvcago0q2x5vgos"; var stateId = "5aed6517-4644-4ce1-aa2a-9b7d8a3e98e3";
//Loading a product into the editor.
//CustomersCanvas.IframeApi.loadEditor(editorFrame[0],'5aed6517-4644-4ce1-aa2a-9b7d8a3e98e3',{ userId: userId }) //works CustomersCanvas.IframeApi.loadEditor(editorFrame[0],{ state: stateId },{ userId: userId }) // don't works
|
|
|
|
Rank: Newbie
Groups: Member, Moderator Joined: 4/18/2018(UTC) Posts: 9
Was thanked: 3 time(s) in 3 post(s)
|
You have to pass stateId as a string, not a key-value pair. Please, try this: Code:
CustomersCanvas.IframeApi.loadEditor(
editorFrame[0],
stateId,
{userId: userId}
)
|
1 user thanked AntonIlinykh for this useful post.
|
|
|
Rank: Advanced Member
Groups: Member
Joined: 3/20/2018(UTC) Posts: 61
Thanks: 4 times
|
THAT's work fine thanks a lot
|
|
|
|
Rank: Newbie
Groups: Member, Moderator Joined: 4/18/2018(UTC) Posts: 9
Was thanked: 3 time(s) in 3 post(s)
|
|
|
|
|
Rank: Advanced Member
Groups: Member
Joined: 3/20/2018(UTC) Posts: 61
Thanks: 4 times
|
SORRY ANTONLLINYKH, i'm back again.
to load State id dynamically, i have created script able to get a variable sent by a previous page by a php post méthod.
I wrote this line to get that variable in my actual page
<div id="stateid"> <P class="white"> <?php $text=$_POST['text']; echo $text; ?></P> </div>.
that's works fine
NOW I need to affect the content of php variable to the StateId like this: var stateId = $(" <?php echo $text;?>");
but it doesn't work. my editor don't lord
Can you help me?
|
|
|
|
Rank: Newbie
Groups: Member, Moderator Joined: 4/18/2018(UTC) Posts: 9
Was thanked: 3 time(s) in 3 post(s)
|
What kind of error in the console do you have? Are you sure, that $text is not empty? And please try this: Code:
var stateId = "<?php $text=$_POST['text']; echo $text;?>";
|
|
|
|
Aurigma Forums
»
Customer's Canvas
»
Discussions – Customer's Canvas
»
Load stateId with iFrame API - How do I load a state Id dynamically using the Iframe API?
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.