Answers.Body: <p>Check <a href="https://issues.civicrm.org/jira/browse/CRM-17228" rel="nofollow">this issue in the bug tracker</a> for some background and possible approaches to resolving this.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-16T21:14:24.007Z
Answers.LastActivityDate: 2015-09-16T21:14:24.007Z
Answers.UserDisplayName: Dave Greenberg
Answers.Body: <p>we found that if we changed the references from "src="/sites/all/modules/civicrm [...]  to a complete url, it would work.  An alternative solution seems to be to strip out all references to civicrm and just implement it using a form field.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-21T01:54:19.907Z
Answers.Text: Are you inserting these snippets on a different URL? Why do you need to specify the full URL? Where are you pasting the snippets?
Answers.UserDisplayName: Laryn
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-21T15:33:27.523Z
Answers.Text: yes, we are. the profile collects information from a non-civicrm site - the user's web site is often hosted elsewhere.
Answers.UserDisplayName: PTP Mark
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-21T15:47:34.917Z
Answers.Text: Ah ha. I've never used the Profile HTML Snippet in that way, but the help text does indicate it should be possible. I edited the question to try to make the issue clearer.
Answers.UserDisplayName: Laryn
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-20T15:43:29.427Z
Answers.LastActivityDate: 2015-04-20T15:43:29.427Z
Answers.UserDisplayName: PTP Mark
Answers.Body: <p>I found this deep in the recesses of Jira: <a href="https://issues.civicrm.org/jira/browse/CRM-4660" rel="nofollow">Standalone Form HTML for Profiles has relative URL</a>. So it was fixed back in 3.0 but must have reverted at some point. As best I can follow, Resources.php builds this via addScriptFile, which calls addScriptUrl, which calls getUrl, which creates the URL by running through the extension manager (CRM/Extension/system.php). I'm not sure of the "correct" place to add the base URL and fix this, but I'm guessing it's in the extension manager system file.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-21T22:09:11.680Z
Answers.Text: I think it's a similar issue, but slightly different. I think the form action is correctly absolute at the moment (which the bug fix you reference took care of), but all the javascript declarations are not.
Answers.UserDisplayName: Laryn
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-21T18:40:54.207Z
Answers.LastActivityDate: 2015-04-21T18:40:54.207Z
Answers.UserDisplayName: Nicholai
Body: <p>When our users create an html snippet for a Profile, it requires a lot of editing to get the references to work. I don't understand why it's written that way.</p>
  
  <p>For reference, here's a snippet of the code for a form that just has first name, last name and email address.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  var CRM = {"config":{"ajaxPopupsEnabled":true,"isFrontend":""}};
  &lt;/script&gt;  
  &lt;script type="text/javascript" src="/sites/all/modules/civicrm/packages/jquery/jquery-1.11.1.min.js?r=ogWA8"&gt;
  &lt;/script&gt;  
  &lt;script type="text/javascript" src="/sites/all/modules/civicrm/packages/jquery/jquery-ui/jquery-ui.min.js?r=ogWA8"&gt;
  &lt;/script&gt;  
  &lt;script type="text/javascript" src="/sites/all/modules/civicrm/packages/backbone/lodash.compat.min.js?r=ogWA8"&gt;
  &lt;/script&gt;  
  &lt;script type="text/javascript" src="/sites/all/modules/civicrm/packages/jquery/plugins/jquery.mousewheel.min.js?r=ogWA8"&gt;
  &lt;/script&gt;  
  </code></pre>
  
  <p>These snippets are used on different websites than the one where CiviCRM is installed, so the local (non-absolute URL) <code>src="/sites/all/...</code> references don't work correctly. </p>
  
  <p>NOTE: The Help text does indicate that this snippet should work on "ANY website":</p>
  
  <p><img src="https://i.sstatic.net/gZOfr.jpg" alt="Profile HTML Snippet help"></p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-04-15T08:22:17.730Z
Comments.Text: Hi mark, Could you edit the question to format the code properly? quite hard to read now
Comments.UserDisplayName: Xavier
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-04-18T03:22:40.850Z
Comments.Text: @PTP Mark: Please indent your code so that users can see it.
Comments.UserDisplayName: Joe Murray
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-04-19T17:42:28.583Z
Comments.Text: It is indented - I revised it after Xavier asked that I "format the code properly" But the issues that you and Xavier are having with reading the code is indication of the difficulty that our end users have trying to work with the html snippet. If the experts can't read it, it presents a problem.  The specific question I have with it is that all the url references are indirect.  I don't see what that has to do with the formatting of the text in this question.
Comments.UserDisplayName: PTP Mark
Tags: <profile><form-snippets>
Title: Why does the html snippet for a profile not include the url of the site for linked Jscript and css files?
ThreadText: # Why does the html snippet for a profile not include the url of the site for linked Jscript and css files?
  
  (Asked by: username_0 on 2015-04-14)
  
  When our users create an html snippet for a Profile, it requires a lot of editing to get the references to work. I don't understand why it's written that way.
  For reference, here's a snippet of the code for a form that just has first name, last name and email address.
    
    
    
    
    
  
  These snippets are used on different websites than the one where CiviCRM is installed, so the local (non-absolute URL) src="/sites/all/... references don't work correctly. 
  NOTE: The Help text does indicate that this snippet should work on "ANY website":
  
  **Tags:** profile, form-snippets
  
  > **Comments:**
  > **username_1**: Hi mark, Could you edit the question to format the code properly? quite hard to read now  
  > **username_2**: @username_0: Please indent your code so that users can see it.  
  > **username_0**: It is indented - I revised it after username_1 asked that I "format the code properly" But the issues that you and username_1 are having with reading the code is indication of the difficulty that our end users have trying to work with the html snippet. If the experts can't read it, it presents a problem.  The specific question I have with it is that all the url references are indirect.  I don't see what that has to do with the formatting of the text in this question.  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_5 on 2015-04-21. Score: 3 | Accepted answer
  
  I found this deep in the recesses of Jira: [Standalone Form HTML for Profiles has relative URL](https://issues.civicrm.org/jira/browse/CRM-4660). So it was fixed back in 3.0 but must have reverted at some point. As best I can follow, Resources.php builds this via addScriptFile, which calls addScriptUrl, which calls getUrl, which creates the URL by running through the extension manager (CRM/Extension/system.php). I'm not sure of the "correct" place to add the base URL and fix this, but I'm guessing it's in the extension manager system file.
  
  > **Comments:**
  > **username_4**: I think it's a similar issue, but slightly different. I think the form action is correctly absolute at the moment (which the bug fix you reference took care of), but all the javascript declarations are not.  
  
  ---
  
  ### Answer by username_3 on 2015-09-16. Score: 1
  
  Check [this issue in the bug tracker](https://issues.civicrm.org/jira/browse/CRM-17228) for some background and possible approaches to resolving this.
  
  
  ---
  
  ### Answer by username_0 on 2015-04-20. Score: 1
  
  we found that if we changed the references from "src="/sites/all/modules/civicrm [...] to a complete url, it would work. An alternative solution seems to be to strip out all references to civicrm and just implement it using a form field.
  
  > **Comments:**
  > **username_4**: Are you inserting these snippets on a different URL? Why do you need to specify the full URL? Where are you pasting the snippets?  
  > **username_0**: yes, we are. the profile collects information from a non-civicrm site - the user's web site is often hosted elsewhere.  
  > **username_4**: Ah ha. I've never used the Profile HTML Snippet in that way, but the help text does indicate it should be possible. I edited the question to try to make the issue clearer.  
  
  ---
  
  