Welcome to TalkGraphics.com
Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19
  1. #11

    Default Re: How to know if javascript is executing?

    First, let me say that I appreciate the detail you've provided. I was able to trim your function down to just one statement, which works to change the color:
    <body onload="changecolor()">


    <script>
    function changecolor() {
    document.getElementById("test").style.color = "red";
    }
    </script>
    But when I plug the exact function into the page body of my XAR, my text does not change. I've tried every combination I can think of ... including changing my text line to a text area. And, yes, I added the HTMLBlockText, per your suggestion.

    Something is different in my XAR that I can't see. Although I'm running Pro X9, your XAR works fine. My file is attached, if you'd like to take a look.

    Color Test.xar

  2. #12
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    21,941

    Default Re: How to know if javascript is executing?

    I'm somewhat stumped. I can't see why your xar doesn't work. However I've added another line to the function, it changes the text but not in reality, as they are both identical, but now it does change the colour:

    document.getElementById("test").innerHTML = "Text that is changed in color";
    I've no idea why that should be..... but it works.

    A further word of warning here. The text colour change is only triggered by body onLoad, so if you're wanting to change this text when a popup is loaded this isn't going to work as the page is already loaded. Such script to change the text or text colour would need to be triggered by the buttons, but as I said earlier that's beyond my knowledge.
    Attached Files Attached Files
    Egg

    Minis Forum UM780XTX AMD Ryzen7 7840HS with AMD Radeon 780M Graphics + 32 GB Ram + MSI Optix Mag321 Curv monitor
    + 1Tb SSD + 232 GB SSD + 250 GB SSD portable drive + ISP = BT + Web Hosting = TSO Host

  3. #13

    Default Re: How to know if javascript is executing?

    The text colour change is only triggered by body onLoad
    Indeed, that's why I moved my test string to the MouseOff layer. The positive result of everything to this point is we have proved that the script actually executes.

    Now, the questions are: What is the xr_v1 function? Where is it defined? Why doesn't it summon the referenced layer? And: Can a javascript even summon a layer?

    Thanks for all that you've done.

  4. #14
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    21,941

    Default Re: How to know if javascript is executing?

    Indeed, that's why I moved my test string to the MouseOff layer.
    But ALL layers get loaded whether they're visible or not, so that makes no odds.

    Now, the questions are: What is the xr_v1 function?
    I don't know where you got the xr_v1 function from orginally....

    The positive result of everything to this point is we have proved that the script actually executes.
    Not sure about the we
    Egg

    Minis Forum UM780XTX AMD Ryzen7 7840HS with AMD Radeon 780M Graphics + 32 GB Ram + MSI Optix Mag321 Curv monitor
    + 1Tb SSD + 232 GB SSD + 250 GB SSD portable drive + ISP = BT + Web Hosting = TSO Host

  5. #15

    Default Re: How to know if javascript is executing?

    xr_v1 was suggested to me in a post in 2013. And I've seen it in a couple of other threads.
    http://www.talkgraphics.com/showthre...yer&highlight=

    I can't see why your xar doesn't work.
    I did skip over that issue in my last response. Hopefully, someone will run it and recognize the fault. For completeness, it's certainly worth understanding.

  6. #16
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    21,941

    Default Re: How to know if javascript is executing?

    xr_v1 is something John (Covoxer) uses a lot in his codeing. Haven't seen him around in ages though. I don't pretend to understand it but I've tried changing it to xr_v2 and on clicking apply get the following warning. But Xara is quite happy with xr_v1

    Copy & Paste the text below, in it's entirety into a Google search:

    site:www.talkgraphics.com/ + xr_v1
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	empty-filename.png 
Views:	74 
Size:	4.8 KB 
ID:	114534  
    Egg

    Minis Forum UM780XTX AMD Ryzen7 7840HS with AMD Radeon 780M Graphics + 32 GB Ram + MSI Optix Mag321 Curv monitor
    + 1Tb SSD + 232 GB SSD + 250 GB SSD portable drive + ISP = BT + Web Hosting = TSO Host

  7. #17

    Default Re: How to know if javascript is executing?

    Yes, those are the threads I had seen. But I widened the search to a full google of "xr_v1(document.getElementById" and found the origin of it all on GitHub: https://gist.github.com/netsi1964/239092

    "Xara Extreme JS extention" is from 2009. I can't follow the javascript, but the fact that it's so extensive indicates to me that someone had big plans for it. Yet, it seems to have seen fairly limited use. But I have to assume its code is still valid for use, as it is (in some way) included with Xara ... although it would be nice if someone spoke up with a fresh 'statement of intent' to clarify its purpose. (There is a short one on GitHub.)

    Regardless of the history, I've concluded that my best course forward is to figure out why my ColorTest.xar does not work. Only then will I be able to repeat my original attempts with xr_v1 and see them work, or not.

    This has been a tough, gravely road, for me. But I haven't abandoned hope that it will lead somewhere.

  8. #18
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    21,941

    Default Re: How to know if javascript is executing?

    Regardless of the history, I've concluded that my best course forward is to figure out why my ColorTest.xar does not work.
    I thought that was fixed by adding the line below to your script as per my ammended xar

    document.getElementById("test").innerHTML = "Text that is changed in color";

    I'll take a look at GitHub link.
    Egg

    Minis Forum UM780XTX AMD Ryzen7 7840HS with AMD Radeon 780M Graphics + 32 GB Ram + MSI Optix Mag321 Curv monitor
    + 1Tb SSD + 232 GB SSD + 250 GB SSD portable drive + ISP = BT + Web Hosting = TSO Host

  9. #19

    Default Re: How to know if javascript is executing?

    fixed by adding the line below to your script
    Indeed, that does force display of the provided text. But what I'm seeking to understand is why your version (without the force) would act on existing text, yet mine would not ... and neither of us can see a difference. Once I can get mine to act on existing text, then I can try the xr_v1, again.

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •