Hi Chris,
you can do something like this:
myAnchor=FALSE
<!IoRangeConditional>
myAnchor=TRUE
<!--<%anc_RelatedLink%>-->
<!/IoRangeConditional>
If myAnchor Then
*[Do something here]*
End If
Regards
Pierre
Am Dienstag, 19. November 2013 17:07:03 UTC+1 schrieb Jian Huang:
>
> Hi Chris,
>
> JavaScript don't cause ASP error because it is not a server side language.
>
> I think what you are seeing is JScript.
>
> There is no way to <a href="javascript:alert('No page has been connected
> to this link.')">test</a> because it has both " (double quote) and '
> (single quote).
>
> However, if you are using C#, you can throw that into a literal tag and
> grab text from literal tag (examples are available via search in this
> forum).
>
> In the same way, if you are using JavaScript, you can throw that into a
> div and use JavaScript to check the content.
>
> -Jian
>
> On Tuesday, November 19, 2013 9:16:48 AM UTC-5, cjh wrote:
>>
>> Thanks for your reply Marco,
>>
>> Any ideas on how to do that so that the preexecute script does not break?
>> Please keep in mind that we can not return the anchor as "path and
>> filename only" and use double quotes instead of single quotes.
>> We actually use the returned name of the anchor and users change it.
>> Tens of thousands of page rely on this existing structure.
>>
>> Thanks for the help.
>> Chris H.
>>
>> On Saturday, November 16, 2013 1:36:12 PM UTC-5, mreddot wrote:
>>
>>> Hi Chris,
>>>
>>> perhaps you need to escape the returning string because of the value
>>> containing apostrophes inside the alert function.
>>>
>>>
>>> Greetings
>>> Marco
>>>
>>>
>>> On Wednesday, November 13, 2013 10:27:08 PM UTC+1, cjh wrote:
>>>>
>>>> We need a method to test an anchor element in javascript to see if it
>>>> has been connected to a page or assigned a URL
>>>> In Version 9 We would just assign the anchor element to a javascript
>>>> variable.
>>>> Something like....
>>>>
>>>> myAnchor='<%anc_RelatedLink%>';
>>>> if (myAnchor != ' '){
>>>> *[Do something here]*
>>>> }
>>>>
>>>> This now will cause an ASP error when the page is opened and the anchor
>>>> is* not* connected to a page.
>>>> It will work if the Achor is referenced to a page or assigend a URL.
>>>> We believe this is possibly due to a change in this element behavior in
>>>> Version 11 that inserts...
>>>> *href="javascript:alert('No page has been connected to this link.')"*into
>>>> the anchor tag if it is not connected.
>>>>
>>>> Does anyone know of a workaround?
>>>> We have unsuccesfully tried a render tag.
>>>>
>>>> <!! Context:CurrentPage.Elements.GetElement(anc_myAnchor).GetHtml() !!>
>>>>
>>>> It either does not return any value or if it does seems to have a
>>>> caching behavior that maintains an older value.
>>>>
>>>> Thanks for any advice you can provide,
>>>>
>>>> Chris
>>>>
>>>>
>>>
--
You received this message because you are subscribed to the Google Groups
"RedDot CMS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/reddot-cms-users.
For more options, visit https://groups.google.com/groups/opt_out.