<div dir="ltr"><br>
<b>Parse error</b>: syntax error, unexpected T_STRING in <b>E:\WorkingProjects\site\modules\mEvents\mEvents.module</b> on line <b>27</b><br><br><div class="gmail_quote">On Fri, Aug 1, 2008 at 1:53 PM, <span dir="ltr"><<a href="mailto:rolf@openusource.com">rolf@openusource.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">In drupal_add_js you will have to specify the path and name to your js file.<br>
<br>
If you are calling drupal_add_js in a module and the js file is located<br>
within the module directory, you should call the function like this:<br>
<br>
drupal_add_js(drupal_get_path('module', 'my_module').'/my_javascript.js');<br>
<br>
If know the absolute path to the file, you should call the function like<br>
this:<br>
<br>
drupal_add_js('some/path/my_javascript.js');<br>
<br>
Note that if you are working with some special modules it might be<br>
necessary to add $base_url to the absolute path, like this:<br>
<br>
global $base_url;<br>
drupal_add_js($base_url.'some/path/my_javascript.js');<br>
<br>
Regards,<br>
rolfington<br>
<div><div></div><div class="Wj3C7c"><br>
<br>
> Am using drupal 5.7<br>
><br>
> i created the custom events display,<br>
><br>
> in that i added the search event ,<br>
><br>
> for that search , i written the validation ,<br>
><br>
> I include the JS file,...<br>
> in the top of the search form,<br>
><br>
> But no use...<br>
><br>
> drupal_add_js("event_search.js")<br>
> strSearch = "";<br>
> for(i=0;i<arrSearch.length;i++){<br>
> strSearch+=arrSearch[i]+"+";<br>
> }<br>
> if(strSearch!=""){<br>
> strSearch = strSearch.substr(0,(strSearch.length-1));<br>
> //alert(strSearch);<br>
> }<br>
> window.location.href="/site1/?q=search/node/event/"+strSearch; return<br>
> false;}</script>';<br>
> $block['content'].= '<form action="/site1/?q=search/node/event"<br>
> name="frm_search_event" accept-charset="UTF-8" method="post"<br>
> id="search-form" class="search-form" onsubmit="return<br>
> event_search_validation();">';<br>
> $block['content'].= '<div><div class="form-item">';<br>
><br>
> $block['content'].= '<div class="container-inline"<br>
> style="margin-right:100px;"><div class="form-item">';<br>
> $block['content'].= '<input type="text" maxlength="255" name="keys"<br>
> id="edit-keys" name="txt_search_event" size="25" value=""<br>
> class="form-text"/>';<br>
> $block['content'].= '</div>';<br>
> $block['content'].= '<input type="image"<br>
> src="files/images/btn-search-events.jpg" align="middle" width="96"<br>
> height="21 name="ops" id="edit-submits" value="Events Search"<br>
> class="form-submit" onClick="javascript:return goToEventSearch();" />';<br>
> $block['content'].= '</div>';<br>
> $block['content'].= '</div>';<br>
> $block['content'].= '<input type="hidden" name="form_token"<br>
> id="edit-search-form-form-token" value="29ae915e9bd7e3eb6d8a484b7095fed5"<br>
> />';<br>
> $block['content'].= '<input type="hidden" name="form_id"<br>
> id="edit-search-form" value="search_form" />';<br>
> $block['content'].= '</div></form>';<br>
><br>
> Thanks u<br>
><br>
><br>
><br>
><br>
><br>
><br>
> On Fri, Aug 1, 2008 at 11:56 AM, <<a href="mailto:rolf@openusource.com">rolf@openusource.com</a>> wrote:<br>
><br>
>> Hi,<br>
>><br>
>> That's the way to do it!<br>
>><br>
>> >From which file do you call drupal_add_js? Make sure that the PHP file<br>
>> is<br>
>> part of your running installation.<br>
>><br>
>> Which version of drupal are you using?<br>
>><br>
>> Regards,<br>
>> Rolfington<br>
>><br>
>> > Hi<br>
>> ><br>
>> ><br>
>> > How to include the JS file ,<br>
>> ><br>
>> > I tried drupal_add_js ,<br>
>> ><br>
>> > but file not included<br>
>> ><br>
>> > Any idea<br>
>> > --<br>
>> > [ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br>
>><br>
>><br>
>> --<br>
>> [ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br>
>><br>
> --<br>
> [ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br>
<br>
<br>
--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br>
</div></div></blockquote></div><br></div>