Since you're using PHP, I can't test anything.
I suspect that the url is being passed as a title list, with [[ and ]], or
that key characters are being stripped.
One way to see, would be to use
wait(url) ;
immediately after
function(url) { ....
Of course you have to save your change and reload for it to become active.
I use this technique whenever I want to see exactly what the JS is
"seeing". I suppose someone more advanced would write to the browser
console.
Good luck!
On Thursday, July 25, 2019 at 9:15:39 AM UTC-7, Jan wrote:
>
> Hello!
> I am trying to build an Interactionmeckanism, were Useres can post and
> On http://szen.io/Test/ it seems to work well... at least for me becaus
> the speed of the connection seems to have impact on this.
> I allows to import texts from my server that can be seen in an Iframe in
> the sidebar, I hope this also works when you open it.
>
> After all worked i transformed it into a plugin an entered it into other
> Wikis like https://www.szen.io/hak/ where it causes Network errors.
> You can reproduce this by clicking one of the posts in $:/
> extensions/Interaction/ImportPosts
>
> the reason seems to be $:/extensions/Interaction/macros/geturltxt.js
> <http://szen.io/Test/#%24%3A%2Fextensions%2FInteraction%2Fmacros%2Fgeturltxt.js>
>
> The Modal gets its Text when it is called with hardcoded url, but not
> something which is created and transcluded like this.
> <$list filter="[[$:/Temp/URL]get[text]]" variable="url">
> <$macrocall $name="geturltxt" url=<<url>> />
> </$list>
>
> Below is the code of the Macro. Do you have any suggestions to fix this?
>
> Tschö+Merci: Jan
>
> /*\
> title: $:/core/modules/macros/geturltxt.js
> type: application/javascript
> module-type: macro
> Makro, das eine Textdatei darstellt
> \*/
>
> (function(){
> /*jslint node: true, browser: true */
> /*global $tw: false */
> "use strict";
>
> /*
> Information about this macro
> */
> exports.name = "geturltxt";
> exports.params = [
> {name: "url"}
> ];
>
> /*
> Run the macro
> */
> exports.run = function(url) {
> var client = new XMLHttpRequest();
> var url = url.replace("+", "%20");
> client.open('GET', url, false);
> client.setRequestHeader('Content-type', 'Content-Type: text/html;
> charset=ISO-8859-1');
> client.onreadystatechange = function() {
> if (client.readyState == 4 && client.status == 200)
> {
> var urltext = unescape(client.responseText);
> var fields = {title: '$:/Temp/URL-Text', text: urltext}
> $tw.wiki.addTiddler(new $tw.Tiddler(fields))
> }
> }
> client.send();
> };
> })();
>
>
>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/d5770a6a-ad3b-4377-9c6d-fa1cda602ba2%40googlegroups.com.