b3fa58bc96f662c6b997ee8003e2cb15a16b68ab
max
  Wed Jan 31 08:05:52 2024 -0800
reload hgTracksif the pix variable is not set, refs #32925

diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c
index 2eca24b..c337b46 100644
--- src/hg/hgTracks/hgTracks.c
+++ src/hg/hgTracks/hgTracks.c
@@ -11126,30 +11126,39 @@
 
 void notify (char *msg, char *msgId)
 /* print a message into a hidden DIV tag, and call Javascript to move the DIV under the
  * tableHeaderForm element and un-hide it. Less obtrusive than a warn() message but still hard to miss. */
 {
 jsInlineF("notifBoxSetup(\"hgTracks\", \"%s\", \"%s\");\n", msgId, msg);
 jsInlineF("notifBoxShow(\"hgTracks\", \"%s\");\n", msgId);
 }
 
 extern boolean issueBotWarning;
 
 void doMiddle(struct cart *theCart)
 /* Print the body of an html file.   */
 {
 cart = theCart;
+
+if (isEmpty(cartOptionalString(cart, "pix")) && !sameOk(cgiRequestMethod(NULL), "POST")) // page reload after POST would lose all vars
+{
+    jsIncludeFile("jquery.js", NULL);
+    jsIncludeFile("utils.js", NULL);
+    jsInlineF("addPixAndReloadPage();");
+    return;
+}
+
 measureTiming = hPrintStatus() && isNotEmpty(cartOptionalString(cart, "measureTiming"));
 if (measureTiming)
     measureTime("Startup (bottleneck delay %d ms, not applied if under %d) ", botDelayMillis, hgBotDelayCurrWarnMs()) ;
 
 char *mouseOverEnabled = cfgOptionDefault("mouseOverEnabled", "on");
 if (sameWordOk(mouseOverEnabled, "on"))
     {
     /* can not use mouseOver in any virtual mode */
     char *isMultiRegion = cartUsualString(cart, "virtModeType", "default");
     if (sameWordOk(isMultiRegion, "default"))
 	{
 	enableMouseOver = TRUE;
 	/* mouseOverJsonFile will be initializes and created at the same
 	 * time as the browser .png image file
 	 */