diff --git a/popups.js b/popups.js
index 57be2ab..5055c29 100644
--- a/popups.js
+++ b/popups.js
@@ -818,6 +818,8 @@ Popups.openPath = function(element, options, parent) {
     success: function(json) {
       // Add additional CSS to the page.
       Popups.addCSS(json.css);
+      // Set the originalPath.
+      json.js.setting.popups.originalPath = returnPath;
       var inlines = Popups.addJS(json.js);
       var popup = Popups.openPathContent(json.path, json.title, json.messages + json.content, element, options, parent);
       Popups.addInlineJS(inlines);
