Hi all

Exception was caused by "\" instead of "/" in the url.

Can you please help me with a last thing ?

At the end of [[UrlContentScript]], I don't manage to concatenate "{{{" + 
p.responseText + "}}}" to keep indentations.

How do I do that ?

Looking forward to read from you

JBo




On Monday, April 13, 2015 at 10:14:07 PM UTC+2, julien23 wrote:
>
> [Exception... "Failure" nsresult: "0x80004005 (NS_ERROR_FAILURE)" 
> location: "JS frame :: file:///S:/satt_prop14/index.html line 17349 > eval 
> line 76 > eval :: _out :: line 13" data: no]
>
> not perfect ...
> I get this error depending on files
>
> On Monday, April 13, 2015 at 9:47:16 PM UTC+2, julien23 wrote:
>>
>> Hi all
>>
>> I finally managed something ... experts might find it dirty :-)
>>
>> <script>
>> var url = '../satt_prop14_dev/matlab/ScoreCalculation14.m';
>>  if ('undefined' == typeof(url)) return false;
>>  var p,rnd;
>>  if (document.all){
>>    // For IE, create an ActiveX Object instance
>>    p = new ActiveXObject("Microsoft.XMLHTTP");
>>  }
>>  else {
>>    // For mozilla, create an instance of XMLHttpRequest.
>>    p = new XMLHttpRequest();
>>  }
>>  p.open("GET",url,false);
>>  p.send(null);
>> var urlContent = p.responseText.toString();
>> wikify(urlContent,place)
>> </script>
>>
>>
>>
>> On Monday, April 13, 2015 at 9:21:10 AM UTC+2, julien23 wrote:
>>>
>>> Hi all
>>>
>>> Thank you for answers.
>>>
>>> <html>
>>> <object data="..\satt_prop14_dev\matlab\ScoreCalculation14.m" type="txt"
>>> >
>>>   File not found.
>>>  </object>
>>> </html>
>>>
>>> works on win7/FF36
>>> win7/Chrome "File not found." not my main browser, maybe it is not 
>>> configured for local files.
>>>
>>> but anyway, I have the same issue than with iframe : the file content is 
>>> exiguous and delimited with both horizontal and vertical scrollbar.
>>>
>>> see TW14_2015_04_13.pdf 
>>> <https://www.sugarsync.com/pf/D7464562_93409053_6658137>
>>>
>>> and even if I manually fit width and height to file content...
>>> <object style="width:650px; height:264em;" data="..\satt_prop14_dev\
>>> matlab\ScoreCalculation14.m" type="txt">
>>> ... then when I print, object is truncated to one page.
>>>
>>> It does not display inline like for example
>>> {{{
>>> contents of your .m file goes here ...
>>> }}}
>>>
>>> I think I am looking for a script that fetch the file content and send 
>>> it as output.
>>>
>>> I have tried to tweak the [AliasScript] Eric did me earlier.
>>> <script>
>>> out=store.getValue("$1","alias")
>>> wikify(out.toString(),place); //Final output
>>> </script>
>>>
>>> with this code :
>>>
>>> <script>
>>> document.include = function (url) {
>>>  if ('undefined' == typeof(url)) return false;
>>>  var p,rnd;
>>>  if (document.all){
>>>    // For IE, create an ActiveX Object instance
>>>    p = new ActiveXObject("Microsoft.XMLHTTP");
>>>  }
>>>  else {
>>>    // For mozilla, create an instance of XMLHttpRequest.
>>>    p = new XMLHttpRequest();
>>>  }
>>>  // Prevent browsers from caching the included page
>>>  // by appending a random  number (optional)
>>>  rnd = Math.random().toString().substring(2);
>>>  url = url.indexOf('?')>-1 ? url+'&rnd='+rnd : url+'?rnd='+rnd;
>>>  // Open the url and write out the response
>>>  p.open("GET",url,false);
>>>  p.send(null);
>>>  document.write( p.responseText );
>>> }
>>> document.include('../satt_prop14_dev/matlab/ScoreCalculation14.m');
>>> </script>
>>>
>>>
>>> I display the file content as text. It wraps properly. But don't manage 
>>> to make it wikify so far ...
>>>
>>> Looking forward to read from you
>>>
>>> JBo
>>>
>>>
>>>
>>> On Saturday, April 11, 2015 at 10:02:15 PM UTC+2, Eric Shulman wrote:
>>>>
>>>> On Saturday, April 11, 2015 at 12:45:08 PM UTC-7, Mat wrote:
>>>>>
>>>>> Maybe something like this. I get this to work with a local txt file:
>>>>>
>>>>>  <object data="..\satt_prop14_dev\matlab\ScoreCalculation14.m" 
>>>>> type="..whateveritis..">
>>>>>   Text showing if file does not show up.
>>>>>  </object>
>>>>>
>>>>
>>>> Excellent solution!  This works for me using Win7/Chrome.  Note that 
>>>> TWClassic needs to have <html>...</html> markers around any HTML syntax, 
>>>> and if you want to use wiki syntax to format the "file not found" text 
>>>> (the 
>>>> content within the <object>...</object> block), then you will need to 
>>>> install
>>>>    http://www.TiddlyTools.com/#HTMLFormattingPlugin
>>>>
>>>> Also, if you don't specify the type="...", the browser defaults to 
>>>> "text/plain".  The type param is only required if you want the browser to 
>>>> attempt to display the file content using an addon "viewer" that was 
>>>> previously installed (e.g., PDF, Excel, Word)
>>>>
>>>> enjoy,
>>>> -e
>>>> Eric Shulman
>>>> TiddlyTools / ELS Design Studios
>>>>
>>>> "Inside TiddlyWiki: The Missing Manual"
>>>>
>>>> https://www.indiegogo.com/projects/inside-tiddlywiki-the-missing-manual/x/8816263
>>>> Note: the IndieGogo funding campaign has ended,
>>>> but direct fundraising continues below...
>>>>
>>>> YOUR DONATIONS ARE VERY IMPORTANT!
>>>> HELP ME TO HELP YOU - MAKE A CONTRIBUTION TO MY "TIP JAR"...
>>>>    http://TiddlyTools.github.com/fundraising.html#MakeADonation
>>>>
>>>> Professional TiddlyWiki Consulting Services...
>>>> Analysis, Design, and Custom Solutions:
>>>>    http://www.TiddlyTools.com/#Contact
>>>>
>>>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/e91ae299-e504-4b97-bbdc-0664967bd906%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to