navigate to a html file with a value

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Mipha
Posts: 77
Joined: 27 Jul 2018, 17:08

navigate to a html file with a value

17 Nov 2018, 07:18

I actually already have a way to do this but I have trouble accessing the value in the html file

Code: Select all

;inside the ahk script
gui, add, edit, h0 w0
gui, font, s10
gui +Border -Caption +lastfound
gui, color, EBAE02
WinSet, TransColor, EBAE02
winsettitle, Test script
guiwidth := A_screenwidth / 1.5
guiheight := A_screenheight / 1.5
Gui, Add, ActiveX, x0 y0 w%guiwidth% h%guiheight% vfeaturedoc, Shell.Browser
featuredoc.navigate("file:///C:/Users/(name)/OneDrive/Desktop/Testhtml.html?value=1")
gui, show
return

Code: Select all

<!-- inside the html file -->
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta http-equiv="X-UA-Compatible" content="ie=11">
	</head>
</html>
<script>
var testbutton = document.createElement('Button');
var testtext = document.createTextNode(location.search);
testbutton.appendChild(testtext);
document.body.appendChild(testbutton);
</script>
This script navigates to a html file placed on your desktop and opens it which then shows a button containing the text placed after the url. In this case that would be ?value=1 however I can only access and use this value during the javascript part meaning if I had to change any of my html layout depending on a value. I have to do all of it in javascript.

Here is my question. Is it possible somehow to use html instead of javascript for this part. here's an example of what I want in the end

Code: Select all

if(value == 1){
<div style='width:100px;'></div>
}
else{
<div style='width:50px;'></div>
}
My mind is going towards a php script but I barely have any knowledge about how I would implement such a thing and if its even possible without external programs.

Also, if there is someplace else where people know about this subject. Please point me there so I can ask the people there about it.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Billykid, mcd and 174 guests