html not working

This section is for posting questions which are not directly related to WYSIWYG Web Builder.
Examples of off topics: web server configuration, hosting, programming related questions, third party scripts.

Note that these questions will generally not be answered by the administrators of this forum.
Post Reply
User avatar
semua
 
 
Posts: 41
Joined: Fri Jan 20, 2017 2:28 am

html not working

Post by semua »

Hello
Why do not my codes work in the "Html" tool? I tried changing it in "Type" but without success.

I am trying to use for example:

Code: Select all

<label id="seconds">10</label>
and no label appears on my page.

I'm trying to use the script below but it's not right. I tested it on the site https://www.w3schools.com/html/tryit.as ... html_intro and it works perfectly:

Code: Select all

<label id="seconds">10
<script>
var secondsLabel = document.getElementById("seconds");
var totalSeconds = 0;
setInterval(setTime, 1000);

function setTime() {
  if (pad(totalSeconds % 60) == 1){
    secondsLabel.innerHTML = "Ok";
    return false;
  }else {
    ++totalSeconds;
    secondsLabel.innerHTML = pad(totalSeconds % 60);
  }

}

function pad(val) {
  var valString = val + "";
  if (valString.length < 2) {
    return "10" - valString;
  } else {
    return valString;
  }
}
</script>
User avatar
Pablo
 
Posts: 21571
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: html not working

Post by Pablo »

First please note that we cannot give support on custom code.

If the code you have added does not work then either the code is invalid, incomplete or there is a conflict with other code on the page.

In this case, I think you will need to add styling to the label.
User avatar
semua
 
 
Posts: 41
Joined: Fri Jan 20, 2017 2:28 am

Re: html not working

Post by semua »

I understand you do not support custom code, but that's not what it's all about. WYSIWYG Web Builder has a tool called "Html" but it does not work so simple codes that work on any other software, site or place.

Look:

Code: Select all

<label id = "seconds"> 10 </ label>
This code should display a label on my page and does not display, it's so simple that it works anywhere. I have tested several other codes that do not work either. Are all the codes I tested incomplete and/or have problems?

I kindly ask you to help me find a solution, ie why do such simple codes do not work in WYSIWYG Web Builder, when they work on any other software or website? Every day I like working with WYSIWYG Web Builder, but this has been hindering me from the beginning.
User avatar
BaconFries
 
 
Posts: 5324
Joined: Thu Aug 16, 2007 7:32 pm

Re: html not working

Post by BaconFries »

The 'Tool' you are referring to is the 'HTML Object' and yes it is part of the software and can be used to insert 'Custom' code. But it is the code script we cannot assist or help you with!. If you wish to use the 'HTML Object' for external code or scripts then you yourself must know how to use these in it. If the code/script doesn't work then you have to check it for being valid so that it can be used. This has nothing to do with the object but the code!.
User avatar
semua
 
 
Posts: 41
Joined: Fri Jan 20, 2017 2:28 am

Re: html not working

Post by semua »

BaconFries wrote: Fri Aug 24, 2018 1:21 pm The 'Tool' you are referring to is the 'HTML Object' and yes it is part of the software and can be used to insert 'Custom' code. But it is the code script we cannot assist or help you with!. If you wish to use the 'HTML Object' for external code or scripts then you yourself must know how to use these in it. If the code/script doesn't work then you have to check it for being valid so that it can be used. This has nothing to do with the object but the code!.

Hello BaconFries.
Do you think the code

Code: Select all

<label id = "seconds"> 10 </ label>
is incorrect? Test it on any site like:
https://www.w3schools.com/html/tryit.as ... html_intro
https://www.lncc.br/~borges/php/testar.html
http://www.play-hookey.com/htmltest/
https://htmledit.squarefree.com/
https://www.jmarshall.com/easy/html/testbed.html
https://jsfiddle.net/

and others, and will see that it works. So the question is, why does not it work with WYSIWYG Web Builder? Is it because the code is "incomplete" or "wrong"? I want to believe something can be done to correct this. ;S
User avatar
Pablo
 
Posts: 21571
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: html not working

Post by Pablo »

The code will be published "AS IS", so if it does not work then the code is not valid or incomplete.

I have tested the code myself and it seems to work fine.
User avatar
Psycho
 
 
Posts: 16
Joined: Wed Oct 18, 2017 1:24 pm

Re: html not working

Post by Psycho »

Pablo wrote: Fri Aug 24, 2018 1:37 pm I have tested the code myself and it seems to work fine.
Same here, no issues at all using the full code and pasted to an HTML object within WYSIWYG

I get a count down from 10 to 1 followed by ok
I have enough money to last me the rest of my life - Providing I die by next Tuesday
User avatar
BaconFries
 
 
Posts: 5324
Joined: Thu Aug 16, 2007 7:32 pm

Re: html not working

Post by BaconFries »

Like Pablo and Psycho I have tested in WBB and it is working..
User avatar
semua
 
 
Posts: 41
Joined: Fri Jan 20, 2017 2:28 am

Re: html not working

Post by semua »

I do not know then what is happening.

Please go to the page and see.
https://bit.ly/2NfMOEP

1. I added a label with id "loginLabel1" and name "test1" using the "label" tool.
2. Now using HTML, type "Do not use <div>" I added the code:
<label for id = "seconds">test2</ label>;

When accessing the source code of the page are there the two codes, the one added by the label tool and the one added by the personal html:

Code: Select all

   <input type="button" id="loginButton1" onclick="window.location.href='./detacid.html';return false;" name="" value="saber(+)">
                        <label for="" id="loginLabel1">test1</label>
                        <label for="" id="seconds">test2</label>
However it is not visible in the site what I add through the custom HTML.
test1 is displayed and test2 is not:
Image
User avatar
BaconFries
 
 
Posts: 5324
Joined: Thu Aug 16, 2007 7:32 pm

Re: html not working

Post by BaconFries »

With the url you have provided there is no reference to the javascript!! without that it cannot run!! You have also add a onclick event to the button this will break the function of the button!! please see the following
viewtopic.php?f=10&t=37833
You have now added another function or extra code...to the original question :roll: as before if you wish to use javascript or other code then you must understand how to use yourself...
User avatar
semua
 
 
Posts: 41
Joined: Fri Jan 20, 2017 2:28 am

Re: html not working

Post by semua »

BaconFries wrote: Fri Aug 24, 2018 2:45 pm With the url you have provided there is no reference to the javascript!! without that it cannot run!! You have also add a onclick event to the button this will break the function of the button!! please see the following
viewtopic.php?f=10&t=37833
You have now added another function or extra code...to the original question :roll: as before if you wish to use javascript or other code then you must understand how to use yourself...
Ok BaconFries, as for javascript I will add reference, thanks!
But what about my label? why test1 is displayed and test2 is not?
User avatar
Pablo
 
Posts: 21571
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: html not working

Post by Pablo »

As previously mentioned, the label does not have any styling.
For example, the font-size is undefined and therefor 0. That is why the label is not visible.
User avatar
semua
 
 
Posts: 41
Joined: Fri Jan 20, 2017 2:28 am

Re: html not working

Post by semua »

Pablo wrote: Fri Aug 24, 2018 6:53 pm As previously mentioned, the label does not have any styling.
For example, the font-size is undefined and therefor 0. That is why the label is not visible.
Ah right now I get it. So, let's go upstairs. Thank you!
Post Reply