Jump to content

s_avinash_s

Members
  • Content Count

    119
  • Joined

  • Last visited

Community Reputation

0 Neutral

About s_avinash_s

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi Event was not getting. whether it was a onclcik or ondclick or other event. That was the problem. after passing the event as argument to function.it works Thanks for the help
  2. Hi i tried with btn.onclick=flva; with btn.addEventListener('click', flva); still same issue
  3. Hi My current code which i tried with document.querySelector is below. The contents in temp1 to temp8 should be visible only when correct user is logged in. Each user has its own priority and some tabs are disabled for some users. <form class ="language_home" action="/passwordcheck.txt" method="post">       Login: <select name='userchoice' > <option value="1">User</option> <option value="2">Supervisor</option> <option value
  4. Hi Actually i tried from https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events#Event_objects there that function is defined . similar way i tried with btn.onclick = function() { But login related part works if i directly assign a value to variable in html code but does not work when i get a value from server and click the particular tab
  5. Hi I tried with following example var btn = document.querySelector('button'); function bgChange() { var rndCol = 'rgb(' + random(255) + ',' + random(255) + ',' + random(255) + ')'; document.body.style.backgroundColor = rndCol; } btn.addEventListener('click', bgChange); but still its same. If i give user_login=1 in html file it works fine. Please help am not exactly getting what is the issue
  6. Hi i did not get what exactly is causing the mismatch for functions. Its not working . How to use event , still not getting
  7. Hi I dont have much idea about event, i have just used a direct code from w3schools for tab creation. Can you please help me, how to use event and how to define in mycode so that it calss the function correctly./
  8. Hi Below is my source code.Is there any mismatch between the calling function and function definition. Please suggest <form class ="language_home" action="/passwordcheck.txt" method="post">       Login: <select name='userchoice' > <option value="1">User</option> <option value="2">Supervisor</option> <option value="3">Admin</option> <option value="4">Service</option>
  9. Hi 4 statements i have modified as mentioned. event is used in tabs script <script> function openCity(evt, cityName) { var i, tabcontent, tablinks; tabcontent = document.getElementsByClassName("tabcontent"); for (i = 0; i < tabcontent.length; i++) { tabcontent[i].style.display = "none"; } tablinks = document.getElementsByClassName("tablinks"); for (i = 0; i < tablinks.length; i++) { tablinks[i].className = tablinks[i].className.replace(" active", ""); } document.getElementById(cityName).style.display = "block"; evt.c
  10. Hi Just got some idea about json objects <p id="demo"></p> <script> var myObj, x; myObj = {"name":"John", "age":30, "car":null}; x = myObj.name; document.getElementById("demo").innerHTML = x; </script> but in ajax am receiving data till now as below if (this.readyState == 4 && this.status == 200) { document.getElementById("demo2").innerHTML = this.responseText; } Now how to get data through ajax and json object. My plan is to receive like below else if ((NX_HTTP_SERVER_GET_REQUEST == request_type) && (0 == strcmp (re
  11. Hi Function call is not happening. i have 7 tabs in my code based on following example https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_tabs Before the tabs are created i have a common section in my web page where it is accessible from any tab.I mean after this section, tabs code comes. So before tabs code is called am calling a function function openCity(evt, cityName) which uses script of tabs code but that script is not being called. My code where function call is not executing is function def() { if(temp1 == 1) { openCity(event, 't
  12. Hi From above i am planning to get whole data to web page( i need to test). Once i get whole data to web page, how to place each data in its specified location in web page
  13. Hi Usually i use ajax to get data every 1 sec for a particular variable as shown below and call that function using setInterval. <p class = "modify" id="demo11"></p> <script> function temp_val() { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("demo11").innerHTML = this.responseText; } }; xhttp.open("GET", "temp_val", true); xhttp.send(); } setInterval(temp_val, 1000); </
  14. Hi Not replacing alert with figure. i need a alert with username , password and login option. For example, if you check this example https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_alert it displays a alert with "Hello! I am an alert box!". Similarly i need a alert with username , password and login option.
  15. Hi Thanks for the info. I got some info about addeventlistener and tried the following code. when i click button it displays the value. Without clicking, is it possible to load the value only once. <!DOCTYPE html> <html> <body> <button id="myBtn">Try it</button> <p id="demo"> <script> var x=100; document.getElementById("myBtn").addEventListener("click", myFunction); function myFunction() { document.getElementById("demo").innerHTML = x; } </script> </body> </html>
×
×
  • Create New...