0

I've created an external javascript document with the extension php and used the line: Header("content-type: application/x-javascript"); in the document to make sure that it is loaded as javascript. Then I loaded it in my module with $doc->addScript() but it seems I can't get at the modules parameters from the js document.

Does anyone know how I can access the module's parameters from this external script? I've tried print_r'ing the _GET and _POST and there is nothing there.

Does anyone have a clue how to get these params in an externally loaded script/stylesheet?

Thanks

1 Answer 1

1

Save the parameters to session or cookie or explicitly hand them over:

the latter would require you to invoke your external module like :

$doc->addScript("path/to/your/js.php?option1=$value1&option2=$value2");

I hope you get the idea.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.